{"id":25990354,"url":"https://github.com/harshdoesdev/rayql","last_synced_at":"2025-03-05T13:54:28.183Z","repository":{"id":231173522,"uuid":"768709398","full_name":"harshdoesdev/rayql","owner":"harshdoesdev","description":"RayQL is a schema definition and query language for SQLite","archived":false,"fork":false,"pushed_at":"2025-01-05T15:48:57.000Z","size":264,"stargazers_count":51,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T16:33:31.749Z","etag":null,"topics":["dsl","query-dsl","query-language","schema","sqlite"],"latest_commit_sha":null,"homepage":"https://rayql.com","language":"Rust","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/harshdoesdev.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,"publiccode":null,"codemeta":null}},"created_at":"2024-03-07T15:35:07.000Z","updated_at":"2025-01-05T15:49:00.000Z","dependencies_parsed_at":"2024-10-30T21:24:12.737Z","dependency_job_id":"07ec7818-bd5c-4b98-9f87-7510cb942a25","html_url":"https://github.com/harshdoesdev/rayql","commit_stats":null,"previous_names":["harshdoesdev/rayql"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshdoesdev%2Frayql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshdoesdev%2Frayql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshdoesdev%2Frayql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshdoesdev%2Frayql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harshdoesdev","download_url":"https://codeload.github.com/harshdoesdev/rayql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039680,"owners_count":20061925,"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":["dsl","query-dsl","query-language","schema","sqlite"],"created_at":"2025-03-05T13:54:27.072Z","updated_at":"2025-03-05T13:54:28.168Z","avatar_url":"https://github.com/harshdoesdev.png","language":"Rust","readme":"# RayQL\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"RayQL Logo\" src=\"./rayql-logo.svg\"\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003cb\u003eRayQL is a schema definition and query language for SQLite.\u003c/b\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n\u003c/p\u003e\n\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/harshdoesdev/rayql/.github%2Fworkflows%2Frust.yml)\n![GitHub License](https://img.shields.io/github/license/harshdoesdev/rayql)\n![Discord](https://img.shields.io/discord/1225854949485711451)\n\n[Join our Discord Channel](https://discord.gg/4re5ShTshg)\n\n## Online Editor\n\nYou can try RayQL using the [Online RayQL editor](https://harshdoesdev.github.io/rayql-studio/).\n\n## Installation\n\nYou can install RayQL by running the following command in your terminal:\n\n```bash\ncurl -s https://rayql.com/install.sh | sh\n```\n\n## Schema Definition\n\nYou can define your database schema by creating a RayQL file called `schema.rayql`.\n\nFor example, it might look something like this:\n\n```rayql\n# Enum for user types\n\nenum user_type {\n    admin\n    developer\n    normal\n}\n\n# Model declaration for 'user'\n\nmodel user {\n    id: int primary_key auto_increment,\n    username: str unique,\n    email: str unique, # this is an inline comment\n    phone_number: str?,\n    user_type: user_type default(user_type.normal)\n}\n\n# Model declaration for 'post'\n\nmodel post {\n    id: int primary_key auto_increment,\n    title: str default('New Post'),\n    content: str,\n    author_id: int foreign_key(user.id),\n    created_at: timestamp default(now()),\n}\n```\n\nThen, when you run the `rayql print` command, it will generate and output the SQL equivalent of that model, which for the above example should look something like this:\n\n```sql\nCREATE TABLE IF NOT EXISTS user (\n    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n    username TEXT NOT NULL UNIQUE,\n    email TEXT NOT NULL UNIQUE,\n    phone_number TEXT NULL,\n    user_type TEXT NOT NULL CHECK(user_type IN ('admin', 'developer', 'normal')) DEFAULT 'normal'\n);\n\nCREATE TABLE IF NOT EXISTS post (\n    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n    title TEXT NOT NULL DEFAULT 'New Post',\n    content TEXT NOT NULL,\n    author_id INTEGER NOT NULL,\n    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n    FOREIGN KEY (author_id) REFERENCES user(id)\n);\n```\n\n## Todo\n\n- [x] Basic Schema Parser\n- [x] `rayql print` command\n- [ ] Database commands\n    - [ ] `rayql db push` and `rayql db pull` commands\n    - [ ] `rayql db migrate` command\n- [ ] Typescript Types generator\n- [ ] Query Parser and Handler\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshdoesdev%2Frayql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshdoesdev%2Frayql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshdoesdev%2Frayql/lists"}