{"id":14984959,"url":"https://github.com/tragedy-labs/sprite","last_synced_at":"2025-09-15T09:07:36.279Z","repository":{"id":248165085,"uuid":"827958264","full_name":"tragedy-labs/sprite","owner":"tragedy-labs","description":"A TypeScript / JavaScript driver for ArcadeDB","archived":false,"fork":false,"pushed_at":"2025-09-03T15:49:46.000Z","size":2062,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-03T17:38:22.347Z","etag":null,"topics":["arcadedb","arcadedb-driver","deno","es6","graph-database","graphdatabase","graphdb","javascript","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://sprite.tragedy.dev","language":"TypeScript","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/tragedy-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-12T18:50:52.000Z","updated_at":"2025-08-20T18:19:15.000Z","dependencies_parsed_at":"2024-09-29T18:41:05.873Z","dependency_job_id":"4141f405-dcdb-43ba-a418-a15001b9334d","html_url":"https://github.com/tragedy-labs/sprite","commit_stats":{"total_commits":82,"total_committers":3,"mean_commits":"27.333333333333332","dds":0.4878048780487805,"last_synced_commit":"8b1bb053760f3d27370d65b690b44d008e8b0abb"},"previous_names":["tragedy-labs/sprite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tragedy-labs/sprite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tragedy-labs%2Fsprite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tragedy-labs%2Fsprite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tragedy-labs%2Fsprite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tragedy-labs%2Fsprite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tragedy-labs","download_url":"https://codeload.github.com/tragedy-labs/sprite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tragedy-labs%2Fsprite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275232781,"owners_count":25428241,"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-09-15T02:00:09.272Z","response_time":75,"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":["arcadedb","arcadedb-driver","deno","es6","graph-database","graphdatabase","graphdb","javascript","nodejs","typescript"],"created_at":"2024-09-24T14:09:55.378Z","updated_at":"2025-09-15T09:07:36.243Z","avatar_url":"https://github.com/tragedy-labs.png","language":"TypeScript","readme":"# Sprite\n\n![Test workflow badge](https://github.com/tragedy-labs/sprite/actions/workflows/commit.yml/badge.svg?event=push)\n\nSprite is a TypeScript driver for ArcadeDB.\n\n[Read the documentation](https://sprite.tragedy.dev), or see the examples below.\n\n## Installation\n\n(Use whichever package manager you prefer)\n\n`\u003cnpm|pnpm|yarn|bun\u003e \u003cinstall|add\u003e @tragedy-labs/sprite`\n\n## Examples\n\n### SpriteServer\n\n```ts\n@import { SpriteServer } from '@tragedy-labs/sprite';\n\nconst server = new SpriteServer({\n  username: 'aUser',\n  password: 'aPassword',\n  address: 'http://localhost:2480'\n});\n\nasync function example() {\n\n  const ready = await server.serverReady();\n  console.log(ready);\n  // true;\n\n  try {\n    const db = await server.createDatabase('aDatabase');\n    console.log(db.name);\n    // 'aDatabase'\n\n    const result = await db.command(\n      'sql',\n      'CREATE document TYPE aType'\n    );\n    console.log(result);\n    // [\n    //   {\n    //     operation: 'create document type',\n    //     typeName: 'aType'\n    //   }\n    // ]\n\n    // CRUD must be transactional\n    // Parameterized commands are used to prevent\n    // SQL injection, parameters are passed in an\n    // object as the third argument\n    db.transaction(async (trx) =\u003e {\n      const doc = trx.crud(\n        'sql',\n        'INSERT INTO aType SET aProperty = :aValue',\n        { aValue: 1 }\n      );\n    });\n  } catch (error) {\n    throw new Error('Could not create database', { cause: error });\n  }\n}\n\nexample();\n\n```\n\n### SpriteDatabase\n\n```ts\n@import { SpriteDatabase } from '@tragedy-labs/sprite';\n@import type {\n  CreateDocumentType,\n  InsertDocument,\n  SelectFrom\n} from '@tragedy-labs/sprite';\n\nconst db = new SpriteDatabase({\n  username: 'aUser',\n  password: 'aPassword',\n  address: 'http://localhost:2480',\n  databaseName: 'aDatabase'\n});\n\ntype ExampleDoc = {\n  aValue: string;\n};\n\nasync function example() {\n  try {\n    const created = await db.command\u003cCreateDocumentType\u003e(\n      'sql',\n      'CREATE document TYPE aType'\n    );\n    console.log(created);\n    // [\n    //   {\n    //     operation: 'create document type',\n    //     type: 'aType'\n    //   }\n    // ]\n\n    const schema = await db.getSchema();\n    console.log(schema);\n    // [...]\n\n    // CRUD must be part of a transaction\n    // Parameterized commands are used to prevent\n    // SQL injection, parameters are passed in an\n    // object as the third argument.\n    db.transaction(async (trx) =\u003e {\n      await trx.crud(\n        'sql',\n        'INSERT INTO aType SET aProperty = :aValue',\n        { aValue: 1 }\n      );\n    });\n\n    const docs = await db.query\u003cSelectFrom\u003cExampleDoc\u003e\u003e(\n      'sql',\n      'SELECT * FROM aType'\n    );\n    console.log(docs);\n    // [\n    //   {\n    //     aProperty: 'aValue'\n    //   }\n    // ]\n\n  } catch (error) {\n    throw new Error('An error occured...', { cause: error });\n  }\n}\n\nexample();\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftragedy-labs%2Fsprite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftragedy-labs%2Fsprite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftragedy-labs%2Fsprite/lists"}