{"id":25039744,"url":"https://github.com/qazcetelic/sqlimagine","last_synced_at":"2025-10-08T08:18:27.789Z","repository":{"id":143440073,"uuid":"469379106","full_name":"QazCetelic/SQLImagine","owner":"QazCetelic","description":"A DSL for quickly and easily designing SQL databases 🗃️.","archived":false,"fork":false,"pushed_at":"2024-04-22T12:30:43.000Z","size":653,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T21:45:53.734Z","etag":null,"topics":["antlr4","domain-specific-language","kotlin","parser","prototyping-tool","relational-databases","sql"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QazCetelic.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-03-13T13:26:23.000Z","updated_at":"2024-04-22T12:30:46.000Z","dependencies_parsed_at":"2024-04-22T13:58:14.963Z","dependency_job_id":null,"html_url":"https://github.com/QazCetelic/SQLImagine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QazCetelic/SQLImagine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QazCetelic%2FSQLImagine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QazCetelic%2FSQLImagine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QazCetelic%2FSQLImagine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QazCetelic%2FSQLImagine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QazCetelic","download_url":"https://codeload.github.com/QazCetelic/SQLImagine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QazCetelic%2FSQLImagine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278910351,"owners_count":26067042,"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-10-08T02:00:06.501Z","response_time":56,"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":["antlr4","domain-specific-language","kotlin","parser","prototyping-tool","relational-databases","sql"],"created_at":"2025-02-06T02:53:10.408Z","updated_at":"2025-10-08T08:18:27.735Z","avatar_url":"https://github.com/QazCetelic.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Logo](graphics/logo_32.svg) SQLImagine\nA tool for quickly and easily designing SQL databases using a DSL and export it to [SQL](#sql-script-export).\n\n## Domain Specific Language\n### Syntax\nSQLImagine allows for defining tables, attributes, and relationships.\nI recommend using [YAML](https://yaml.org) syntax highlighting because the DSL's syntax has a few similarities.\nThe recommended file extension is `.sqli`.\n\n```yaml\n# It's possible to add comments.\n\nCar:\n  # The '!' means it's a primary key field.\n  !name (Str)\n  produced (Date)\n  manufacturer (Str) -\u003e Manufacturer.name\n  color (Str)\n  price (Dec)\n  self_driving (Bool)\n  \nManufacturer:\n  name (Str)\n  founded (Date)\n  headquarters (Str)\n  employees (Int)\n  # The '?' signifies it's nullable.\n  parent_company? (Str) -\u003e Manufacturer.name\n```\n\n### Usage\nParsing is done using the `ParseInstance` class. It's created with a script as a string.\n\n```kotlin\nval scriptFile: File = …\nval script: String = scriptFile.readText()\nval parsed = ParseInstance(sqli)\n// Print out a formatted version of the script.\nprintln(parsed)\n```\n\nThe parser is also able to reformat existing scripts by calling `.serialize()` on the created `ParseInstance`.\nThe class also has several accessible properties:\n\n|  Property  | Description                                                      |\n|:----------:|:-----------------------------------------------------------------|\n|  `tables`  | All parsed tables                                                |\n|  `errors`  | All errors, issues that prevent the script from properly parsing |\n| `warnings` | All warnings, issues that aren't critical but do require changes |\n| `success`  | Whether there are any critical issues                            |\n|   `time`   | The amount of milliseconds it took to parse the DSL              |\n\n## SQL script export\nYou can export the parsed DSL as a SQL script by using the `Sequelizer` class on the parsed DSL.\n\n```kotlin\nval sequelizer = Sequelizer(\"test_db\")\nval sql: String = sequelizer.sequelize(parsed)\n```\n\n![Example](graphics/usage.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqazcetelic%2Fsqlimagine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqazcetelic%2Fsqlimagine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqazcetelic%2Fsqlimagine/lists"}