{"id":19839430,"url":"https://github.com/scientifichackers/sql2code","last_synced_at":"2026-05-16T07:13:09.308Z","repository":{"id":57470426,"uuid":"220269295","full_name":"scientifichackers/sql2code","owner":"scientifichackers","description":"Convert SQL to import-able code!","archived":false,"fork":false,"pushed_at":"2019-11-07T15:34:53.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T22:06:25.629Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/scientifichackers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-07T15:32:02.000Z","updated_at":"2021-02-22T12:08:55.000Z","dependencies_parsed_at":"2022-09-19T10:01:53.383Z","dependency_job_id":null,"html_url":"https://github.com/scientifichackers/sql2code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fsql2code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fsql2code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fsql2code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientifichackers%2Fsql2code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scientifichackers","download_url":"https://codeload.github.com/scientifichackers/sql2code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241209542,"owners_count":19927734,"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":[],"created_at":"2024-11-12T12:22:24.979Z","updated_at":"2026-05-16T07:13:04.269Z","avatar_url":"https://github.com/scientifichackers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL 2 code\n\nThis project lets you write functions in SQL and import them in code.  \n\nCurrently, it only supports dart.\n\n```console\n$ pip install sql2code\n```\n\n```sql\n-- queries1.sql\nlistMessages(sender, limit, offset) {\n    SELECT *\n      FROM message\n     WHERE sender = $sender  \n  ORDER BY sentAt\n     LIMIT $limit OFFSET $offset;\n}\n```\n\n```console\n$ sql2dart quries.sql queries.dart \n```\n\n```dart\n// queries.dart\nimport 'package:sqflite/sqflite.dart';\n\nFuture\u003cList\u003cMap\u003cString, dynamic\u003e\u003e\u003e listMessages(\n  Database db,\n  sender,\n  limit,\n  offset,\n) async {\n  return await db.transaction((txn) async {\n    return await txn.rawQuery(\n      \"\"\"SELECT * FROM message WHERE sender =  ? ORDER BY sentAt LIMIT ? OFFSET ? \"\"\",\n      [sender, limit, offset],\n    );\n  });\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientifichackers%2Fsql2code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscientifichackers%2Fsql2code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientifichackers%2Fsql2code/lists"}