{"id":24537719,"url":"https://github.com/dwdw2/parser-orm","last_synced_at":"2025-08-03T14:07:56.606Z","repository":{"id":273275651,"uuid":"914489655","full_name":"DWDW2/parser-orm","owner":"DWDW2","description":"Small custom-syntax javascript ORM","archived":false,"fork":false,"pushed_at":"2025-02-08T17:20:53.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T01:26:18.795Z","etag":null,"topics":["javascript","parser","recursive-descent-parser","sql-generator"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DWDW2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-09T17:40:48.000Z","updated_at":"2025-02-08T17:20:56.000Z","dependencies_parsed_at":"2025-01-19T23:34:25.144Z","dependency_job_id":"e58e5c0a-515f-4075-ba54-1d48e61a955a","html_url":"https://github.com/DWDW2/parser-orm","commit_stats":null,"previous_names":["dwdw2/parser-orm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DWDW2/parser-orm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DWDW2%2Fparser-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DWDW2%2Fparser-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DWDW2%2Fparser-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DWDW2%2Fparser-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DWDW2","download_url":"https://codeload.github.com/DWDW2/parser-orm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DWDW2%2Fparser-orm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268554909,"owners_count":24269062,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","parser","recursive-descent-parser","sql-generator"],"created_at":"2025-01-22T14:13:34.385Z","updated_at":"2025-08-03T14:07:56.583Z","avatar_url":"https://github.com/DWDW2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parser-orm\n\nThis is a project to genreate create sql schemas using custom defined syntax and\nuse javascript functions to query database.\n\n## Installation\n\nTo install the dependencies, run:\n\n```bash\nnpm install\n```\n\n## Usage\n\nTo generate SQL schemas, use the following command:\n\n```bash\norm init\n```\n\nTo query the database, use the provided JavaScript functions. Here is an\nexample:\n\n```javascript\nimport fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { Parser } from \"../orm/parser.js\";\nimport { OrmClient } from \"../orm/client.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst syntaxFilePath = path.resolve(__dirname, \"schemas/schema.orm\");\nconst syntax = fs.readFileSync(syntaxFilePath, \"utf-8\");\nconst parser = new Parser();\nconst ast = parser.parse(syntax);\n\nconst dbFilePath = path.resolve(__dirname, \"database.sqlite\");\nconst config = {\n  filename: dbFilePath,\n};\n\nconst client = new OrmClient(config, ast);\n\n(async () =\u003e {\n  await client.connect();\n\n  try {\n    const newUser = await client.users.query({\n      select: [\"id\", \"username\", \"email\", \"created_at\"],\n    });\n    console.log(\"Inserted user:\", newUser);\n  } catch (error) {\n    if (error.code === \"SQLITE_CONSTRAINT\") {\n      console.error(\"Error inserting user: Email must be unique\");\n    } else {\n      console.error(\"Error inserting user:\", error);\n    }\n  }\n\n  await client.disconnect();\n})();\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwdw2%2Fparser-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwdw2%2Fparser-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwdw2%2Fparser-orm/lists"}