{"id":21170067,"url":"https://github.com/covenantsql/cql-js-driver","last_synced_at":"2025-07-26T17:07:16.959Z","repository":{"id":40790740,"uuid":"175153046","full_name":"CovenantSQL/cql-js-driver","owner":"CovenantSQL","description":"Interact with CovenantSQL via proxy in web and node","archived":false,"fork":false,"pushed_at":"2022-12-03T01:45:24.000Z","size":275,"stargazers_count":5,"open_issues_count":18,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T20:52:13.932Z","etag":null,"topics":["covenantsql","cql","npm-package"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CovenantSQL.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}},"created_at":"2019-03-12T06:58:19.000Z","updated_at":"2022-04-01T07:32:09.000Z","dependencies_parsed_at":"2023-01-23T04:15:36.586Z","dependency_job_id":null,"html_url":"https://github.com/CovenantSQL/cql-js-driver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CovenantSQL/cql-js-driver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2Fcql-js-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2Fcql-js-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2Fcql-js-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2Fcql-js-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CovenantSQL","download_url":"https://codeload.github.com/CovenantSQL/cql-js-driver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CovenantSQL%2Fcql-js-driver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267198680,"owners_count":24051559,"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-07-26T02:00:08.937Z","response_time":62,"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":["covenantsql","cql","npm-package"],"created_at":"2024-11-20T15:55:55.004Z","updated_at":"2025-07-26T17:07:16.921Z","avatar_url":"https://github.com/CovenantSQL.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cql-js-driver\n\nThis repo is javascript lib to interact with [CovenantSQL](https://github.com/CovenantSQL/CovenantSQL) local proxy.\n\n## Install\n\nInstall `cql-js-driver` via npm or yarn:\n```bash\nnpm install --save cql-js-driver\n```\nor\n```bash\nyarn add cql-js-driver\n```\n\n## Get started\nFollow CovenantSQL [QuickStart](https://testnet.covenantsql.io/quickstart) to get you prepared.\n\n### use testnet proxy directly\n\nWe provides testnet proxy for your testing: `http(s)://testnet-proxy.covenantsql.io`\n\n```javascript\nconst config = {\n    endpoint: 'http://testnet-proxy.covenantsql.io',\n    dbid: `${DB_ID}`, // your DB id created by `cql` tools in QuickStart\n}\n```\n\n### if you setup your own proxy\n\n1. set up CovenantSQL local proxy\n\n```bash\n$ go get github.com/CovenantSQL/CovenantSQL\n$ make bin/cql\n$ rsync -avP ./conf/testnet/{config.yaml,private.key} ~/.cql/\n$ ./bin/cql -adapter 127.0.0.1:11105\n```\n\n2. fill in the configs\n\n```javascript\nconst config = {\n    endpoint: '127.0.0.1:11105', // local testnet endpoint without https\n    dbid: `${DB_ID}`, // your DB id created by `cql` tools\n}\n```\n\n### connect and query\n```typescript\nimport cql from 'cql-js-driver'\n\nconst config = {...} // see above\n\ncql.createConnection(config).then(async (connection: any) =\u003e {\n    // read\n    const data1 = await connection.query(\"select ? + ?\", [2.1, 3.2]);\n    console.log(data1);\n\n    // write\n    const createTableSQL = `\n    CREATE TABLE IF NOT EXISTS contacts (\\\n    contact_id INTEGER PRIMARY KEY,\n    first_name TEXT NOT NULL,\n    last_name TEXT NOT NULL,\n    email text NOT NULL UNIQUE,\n    phone text NOT NULL UNIQUE\n    );\n    `\n    const status1 = await connection.exec(createTableSQL)\n    console.log(`exec1 status:`, status1);\n\n    const data2 = await connection.query(\"show tables;\");\n    console.log(data2);\n}).catch((e: any) =\u003e console.log(e))\n```\n\n## Contribution\n\n- `yarn dev`\n- open `http://localhost:8080/examples/`\n\n## License\n\n[Apache-2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovenantsql%2Fcql-js-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcovenantsql%2Fcql-js-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovenantsql%2Fcql-js-driver/lists"}