{"id":22611494,"url":"https://github.com/fbraem/sql-smith","last_synced_at":"2025-11-02T09:02:46.772Z","repository":{"id":57470624,"uuid":"358687147","full_name":"fbraem/sql-smith","owner":"fbraem","description":"An SQL query builder with zero dependencies and a fluent interface","archived":false,"fork":false,"pushed_at":"2025-03-07T18:28:04.000Z","size":332,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T18:52:03.472Z","etag":null,"topics":["fluent","python","python3","query","query-builder","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbraem.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-16T18:29:15.000Z","updated_at":"2025-03-07T18:28:08.000Z","dependencies_parsed_at":"2025-03-07T19:34:48.331Z","dependency_job_id":null,"html_url":"https://github.com/fbraem/sql-smith","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbraem%2Fsql-smith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbraem%2Fsql-smith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbraem%2Fsql-smith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbraem%2Fsql-smith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbraem","download_url":"https://codeload.github.com/fbraem/sql-smith/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248360056,"owners_count":21090642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fluent","python","python3","query","query-builder","sql"],"created_at":"2024-12-08T16:11:23.142Z","updated_at":"2025-11-02T09:02:46.477Z","avatar_url":"https://github.com/fbraem.png","language":"Python","readme":"=========\nsql-smith\n=========\n\n**sql-smith** is an SQL query builder with zero dependencies and a fluent interface.\n\n    The sentence above is, beside the name, a copy from the website of the PHP library\n    Latitude_, for the simple reason that this Python module is a port of Latitude.\n\nRead the full `documentation \u003chttps://fbraem.github.io/sql-smith\u003e`_.\n\nInstallation\n************\n\n.. code-block:: sh\n\n    $ pip install sql-smith\n\nQuick Start\n***********\n\nQueryFactory is a factory to create a **SELECT**, **INSERT**, **UPDATE** or **DELETE** query.\nUse the fluent interface of the queries to complete the query.\n\n.. code-block:: python\n\n    from sql_smith import QueryFactory\n    from sql_smith.engine import CommonEngine\n    from sql_smith.functions import field\n    \n    factory = QueryFactory(CommonEngine())\n    query = factory \\\n        .select('id', 'username') \\\n        .from_('users') \\\n        .where(field('id').eq(5)) \\\n        .compile()\n    \n    print(query.sql)  # SELECT \"id\", \"username\" FROM \"users\" WHERE \"id\" = ?\n    print(query.params)  # (5)\n\nWhen the query is ready, compile it. The return value of compile is a Query class instance\nwith two properties: sql and params. Use these properties to pass the query to a database.\n\n.. code-block:: python\n\n    import sqlite3\n    \n    db = sqlite3.connect('test.db')\n    cur = db.cursor()\n\n    for row in cur.execute(query.sql, query.params):\n        print(row)\n\n.. _Latitude: https://latitude.shadowhand.com/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbraem%2Fsql-smith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbraem%2Fsql-smith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbraem%2Fsql-smith/lists"}