{"id":13412333,"url":"https://github.com/btnguyen2k/gocosmos","last_synced_at":"2026-02-20T10:31:52.494Z","repository":{"id":37850224,"uuid":"318972683","full_name":"btnguyen2k/gocosmos","owner":"btnguyen2k","description":"Go database/sql driver for Azure Cosmos DB SQL API","archived":false,"fork":false,"pushed_at":"2024-05-12T05:59:23.000Z","size":9994,"stargazers_count":22,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-31T20:50:46.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/btnguyen2k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-12-06T07:03:43.000Z","updated_at":"2024-06-15T04:29:28.000Z","dependencies_parsed_at":"2023-11-19T06:29:57.221Z","dependency_job_id":"94257939-96d2-4322-87f3-35bc79e48b9a","html_url":"https://github.com/btnguyen2k/gocosmos","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/btnguyen2k/gocosmos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btnguyen2k%2Fgocosmos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btnguyen2k%2Fgocosmos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btnguyen2k%2Fgocosmos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btnguyen2k%2Fgocosmos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btnguyen2k","download_url":"https://codeload.github.com/btnguyen2k/gocosmos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btnguyen2k%2Fgocosmos/sbom","scorecard":{"id":256812,"data":{"date":"2025-08-11","repo":{"name":"github.com/btnguyen2k/gocosmos","commit":"f77d8c6b66b4eb242cad1ffd76297f95880f08ce"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yaml:18","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yaml:19","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yaml:54","Warn: topLevel 'contents' permission set to 'write': .github/workflows/automerge-dependabot.yaml:10","Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Warn: no topLevel permission defined: .github/workflows/codeql.yaml:1","Warn: no topLevel permission defined: .github/workflows/release.yaml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/automerge-dependabot.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/automerge-dependabot.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:111: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:113: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:137: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:139: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:159: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:174: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:176: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:196: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:248: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:250: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:270: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:211: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:213: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:233: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:285: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:287: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:307: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:322: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:324: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:344: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:96: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/codeql.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/codeql.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/codeql.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/codeql.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/release.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/release.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:146: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/release.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/release.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/release.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/btnguyen2k/gocosmos/release.yaml/main?enable=pin","Info:   0 out of  32 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  11 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T09:53:55.725Z","repository_id":37850224,"created_at":"2025-08-17T09:53:55.725Z","updated_at":"2025-08-17T09:53:55.725Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29647894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-07-30T20:01:23.527Z","updated_at":"2026-02-20T10:31:52.478Z","avatar_url":"https://github.com/btnguyen2k.png","language":"Go","funding_links":[],"categories":["Database Drivers","数据库驱动程序","Data Integration Frameworks","Generators","NoSQL Databases"],"sub_categories":["NoSQL Database Drivers","Advanced Console UIs","NoSQL数据库驱动程序"],"readme":"# gocosmos\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/btnguyen2k/gocosmos)](https://goreportcard.com/report/github.com/btnguyen2k/gocosmos)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/btnguyen2k/gocosmos)](https://pkg.go.dev/github.com/btnguyen2k/gocosmos)\n[![Actions Status](https://github.com/btnguyen2k/gocosmos/workflows/gocosmos/badge.svg)](https://github.com/btnguyen2k/gocosmos/actions)\n[![codecov](https://codecov.io/gh/btnguyen2k/gocosmos/branch/main/graph/badge.svg)](https://codecov.io/gh/btnguyen2k/gocosmos)\n[![Release](https://img.shields.io/github/release/btnguyen2k/gocosmos.svg?style=flat-square)](RELEASE-NOTES.md)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go#database-drivers)\n\nGo driver for [Azure Cosmos DB SQL API](https://azure.microsoft.com/services/cosmos-db/) which can be used with the standard [database/sql](https://golang.org/pkg/database/sql/) package. A REST client is also included.\n\n## database/sql driver\n\nSummary of supported SQL statements:\n\n| Statement                                   | Syntax                                                                                   |\n|---------------------------------------------|------------------------------------------------------------------------------------------|\n| Create a new database                       | `CREATE DATABASE [IF NOT EXISTS] \u003cdb-name\u003e`                                              |\n| Change database's throughput                | `ALTER DATABASE \u003cdb-name\u003e WITH RU/MAXRU=\u003cru\u003e`                                            |\n| Delete an existing database                 | `DROP DATABASE [IF EXISTS] \u003cdb-name\u003e`                                                    |\n| List all existing databases                 | `LIST DATABASES`                                                                         |\n| Create a new collection                     | `CREATE COLLECTION [IF NOT EXISTS] [\u003cdb-name\u003e.]\u003ccollection-name\u003e \u003cWITH PK=partitionKey\u003e` |\n| Change collection's throughput              | `ALTER COLLECTION [\u003cdb-name\u003e.]\u003ccollection-name\u003e WITH RU/MAXRU=\u003cru\u003e`                      |\n| Delete an existing collection               | `DROP COLLECTION [IF EXISTS] [\u003cdb-name\u003e.]\u003ccollection-name\u003e`                              |\n| List all existing collections in a database | `LIST COLLECTIONS [FROM \u003cdb-name\u003e]`                                                      |\n| Insert a new document into collection       | `INSERT INTO [\u003cdb-name\u003e.]\u003ccollection-name\u003e ...`                                          |\n| Insert or replace a document                | `UPSERT INTO [\u003cdb-name\u003e.]\u003ccollection-name\u003e ...`                                          |\n| Delete an existing document                 | `DELETE FROM [\u003cdb-name\u003e.]\u003ccollection-name\u003e WHERE id=\u003cid-value\u003e`                          |\n| Update an existing document                 | `UPDATE [\u003cdb-name\u003e.]\u003ccollection-name\u003e SET ... WHERE id=\u003cid-value\u003e`                       |\n| Query documents in a collection             | `SELECT [CROSS PARTITION] ... FROM \u003ccollection-name\u003e ... [WITH database=\u003cdb-name\u003e]`      |\n\nSee [supported SQL statements](SQL.md) for details.\n\n\u003e Azure Cosmos DB SQL API currently supports only [SELECT statement](https://learn.microsoft.com/azure/cosmos-db/nosql/query/select).\n\u003e `gocosmos` implements other statements by translating the SQL statement to [REST API calls](https://learn.microsoft.com/rest/api/cosmos-db/).\n\n### Example usage:\n\n```go\npackage main\n\nimport (\n\t\"database/sql\"\n\t_ \"github.com/btnguyen2k/gocosmos\"\n)\n\nfunc main() {\n\tdriver := \"gocosmos\"\n\tdsn := \"AccountEndpoint=https://localhost:8081/;AccountKey=\u003ccosmosdb-account-key\u003e\"\n\tdb, err := sql.Open(driver, dsn)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer db.Close()\n\t\n\t_, err = db.Exec(\"CREATE DATABASE mydb WITH maxru=10000\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t\n\t// database \"mydb\" has been created successfuly\n}\n```\n\n**Data Source Name (DSN) syntax for Cosmos DB**\n\n_Note: line-break is for readability only!_\n\n```connection\nAccountEndpoint=\u003ccosmosdb-endpoint\u003e\n;AccountKey=\u003ccosmosdb-account-key\u003e\n[;TimeoutMs=\u003ctimeout-in-ms\u003e]\n[;Version=\u003ccosmosdb-api-version\u003e]\n[;DefaultDb|Db=\u003cdb-name\u003e]\n[;AutoId=\u003ctrue/false\u003e]\n[;InsecureSkipVerify=\u003ctrue/false\u003e]\n```\n\n- `AccountEndpoint`: (required) endpoint to access Cosmos DB. For example, the endpoint for Azure Cosmos DB Emulator running on local is `https://localhost:8081/`.\n- `AccountKey`: (required) account key to authenticate.\n- `TimeoutMs`: (optional) operation timeout in milliseconds. Default value is `10 seconds` if not specified.\n- `Version`: (optional) version of Cosmos DB to use. Default value is `2020-07-15` if not specified. See: https://learn.microsoft.com/rest/api/cosmos-db/#supported-rest-api-versions.\n- `DefaultDb`: (optional, available since [v0.1.1](RELEASE-NOTES.md)) specify the default database used in Cosmos DB operations. Alias `Db` can also be used instead of `DefaultDb`.\n- `AutoId`: (optional, available since [v0.1.2](RELEASE-NOTES.md)) see [auto id](#auto-id) session.\n- `InsecureSkipVerify`: (optional, available since [v0.1.4](RELEASE-NOTES.md)) if `true`, disable CA verification for https endpoint (useful to run against test/dev env with local/docker Cosmos DB emulator).\n\n### Auto-id\n\nAzure Cosmos DB requires each document has a [unique ID](https://learn.microsoft.com/rest/api/cosmos-db/documents) that identifies the document.\nWhen creating new document, if value for the unique ID field is not supplied `gocosmos` is able to generate one automatically. This feature is enabled\nby specifying setting `AutoId=true` in the Data Source Name (for `database/sql` driver) or the connection string (for REST client). If not specified, default\nvalue is `AutoId=true`.\n\n_This setting is available since [v0.1.2](RELEASE-NOTES.md)._\n\n### Known issues\n\n**`GROUP BY` combined with `ORDER BY` is not supported**\n\nAzure Cosmos DB does not support `GROUP BY` combined with `ORDER BY` yet. You will receive the following error message:\n\n\u003e 'ORDER BY' is not supported in presence of GROUP BY.\n\n**Cross-partition paging**\n\nCross-partition paging can be done with the `OFFSET...LIMIT` clause. However, the query is not stable without `ORDER BY`. The returned results may not be consistent from query to query.\n\n**Queries that may consume a large amount of memory**\n\nThese queries may consume a large amount of memory if executed against a large table:\n\n- `OFFSET...LIMIT` clause with big offset or limit values.\n- `SELECT DISTINCT` and `SELECT DISTINCT VALUE` queries.\n- Queries with `GROUP BY` clause.\n\n## REST client\n\nSee the [REST.md](REST.md) file for details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Support and Contribution\n\n\u003e Disclaimer: I am also a core maintainer of [microsoft/gocosmos](https://github.com/microsoft/gocosmos/). Features and bug fixes are synchronized between the two projects.\n\nThis project uses [GitHub Issues](https://github.com/btnguyen2k/gocosmos/issues) to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue.\n\nPlease create [pull requests](https://github.com/microsoft/gocosmos/pulls) in the [microsoft/gocosmos](https://github.com/microsoft/gocosmos/) repository.\n\nIf you find this project useful, please start it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtnguyen2k%2Fgocosmos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtnguyen2k%2Fgocosmos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtnguyen2k%2Fgocosmos/lists"}