{"id":26372799,"url":"https://github.com/moedevelops/starmap","last_synced_at":"2026-01-04T04:08:21.752Z","repository":{"id":246107386,"uuid":"819550015","full_name":"MoeDevelops/starmap","owner":"MoeDevelops","description":"🌌 Type-Safe SQL Library for Gleam","archived":false,"fork":false,"pushed_at":"2024-09-01T09:04:41.000Z","size":64,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T23:37:52.460Z","etag":null,"topics":["gleam","orm","sql"],"latest_commit_sha":null,"homepage":"","language":"Gleam","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/MoeDevelops.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-06-24T18:25:15.000Z","updated_at":"2024-11-08T09:47:17.000Z","dependencies_parsed_at":"2024-08-10T12:25:27.845Z","dependency_job_id":"ba6549ba-ed08-4bd6-9f33-d5215767c6c6","html_url":"https://github.com/MoeDevelops/starmap","commit_stats":null,"previous_names":["moedevelops/starmap"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoeDevelops%2Fstarmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoeDevelops%2Fstarmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoeDevelops%2Fstarmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoeDevelops%2Fstarmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoeDevelops","download_url":"https://codeload.github.com/MoeDevelops/starmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955762,"owners_count":20374373,"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":["gleam","orm","sql"],"created_at":"2025-03-17T01:19:21.788Z","updated_at":"2026-01-04T04:08:21.670Z","avatar_url":"https://github.com/MoeDevelops.png","language":"Gleam","readme":"# Starmap\n\n**THIS IS VERY WORK IN PROGRESS! EVERYTHING CAN (and probably will) BREAK!**\n\nBut feel free to try it out!\n\n[![Package Version](https://img.shields.io/hexpm/v/starmap)](https://hex.pm/packages/starmap)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/starmap/)\n\n## Plans for v0.1.X (Current)\n\n- Fix bugs that might occur\n- Support all operations with 1-9 columns\n- Start with documentation\n\n## Plans for v0.2.0\n\n- Better documentation\n- Split project to `starmap` and `starmap_sqlight`\n- Remove dependency of `sqlight` from `starmap`\n- Create `starmap_pgo`\n\n## Usage\n\n```sh\ngleam add starmap\n```\n\n```gleam\nimport gleam/int\nimport gleam/io\nimport gleam/list\nimport gleam/option.{type Option, None, Some}\nimport sqlight\nimport starmap/creation\nimport starmap/insertion\nimport starmap/query\nimport starmap/schema.{type Column, Column, PrimaryKey}\nimport starmap/sqlight/execute\nimport starmap/sqlight/types\n\nconst accounts_table = \"accounts\"\n\nconst accounts = Accounts(\n  id: Column(accounts_table, \"id\", types.integer, [PrimaryKey]),\n  name: Column(accounts_table, \"name\", types.text, []),\n  avatar: Column(accounts_table, \"avatar\", types.text_nullable, []),\n)\n\npub type Accounts(a) {\n  Accounts(\n    id: Column(Int, a),\n    name: Column(String, a),\n    avatar: Column(Option(String), a),\n  )\n}\n\npub fn main() {\n  use conn \u003c- sqlight.with_connection(\":memory:\")\n\n  let assert Ok(_) =\n    accounts_table\n    |\u003e creation.create_table3(accounts.id, accounts.name, accounts.avatar)\n    |\u003e execute.create_table3(conn)\n\n  let assert Ok(_) =\n    insertion.insert_into(accounts_table)\n    |\u003e insertion.columns2(accounts.name, accounts.avatar)\n    |\u003e insertion.values([\n      #(\"Lucy\", Some(\"lucy.svg\")),\n      #(\"John Doe\", None),\n      #(\"MoeDev\", None),\n    ])\n    |\u003e execute.insertion2(conn)\n\n  let assert Ok(results) =\n    query.from(accounts_table)\n    |\u003e query.select3(accounts.id, accounts.name, accounts.avatar)\n    |\u003e execute.query3(conn)\n\n  results\n  |\u003e list.map(fn(row) {\n    let #(id, name, avatar) = row\n    int.to_string(id) \u003c\u003e \" \" \u003c\u003e name \u003c\u003e \" \" \u003c\u003e option.unwrap(avatar, \"\")\n  })\n  |\u003e list.each(io.println)\n  // 1 Lucy lucy.svg\n  // 2 John Doe \n  // 3 MoeDev\n}\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/starmap\u003e.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoedevelops%2Fstarmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoedevelops%2Fstarmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoedevelops%2Fstarmap/lists"}