{"id":22508988,"url":"https://github.com/viant/dyndb","last_synced_at":"2026-05-14T21:37:00.254Z","repository":{"id":62867175,"uuid":"560538952","full_name":"viant/dyndb","owner":"viant","description":"Dynamodb driver to database/sql","archived":false,"fork":false,"pushed_at":"2022-12-14T04:34:32.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-03-11T04:09:50.353Z","etag":null,"topics":["database","driver","dynamodb","golang","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","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/viant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-11-01T18:09:54.000Z","updated_at":"2022-12-21T03:41:18.000Z","dependencies_parsed_at":"2023-01-28T17:00:59.842Z","dependency_job_id":null,"html_url":"https://github.com/viant/dyndb","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/viant/dyndb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdyndb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdyndb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdyndb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdyndb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viant","download_url":"https://codeload.github.com/viant/dyndb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdyndb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33044358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":["database","driver","dynamodb","golang","sql"],"created_at":"2024-12-07T01:26:30.165Z","updated_at":"2026-05-14T21:37:00.236Z","avatar_url":"https://github.com/viant.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamodb SQL Driver\n\n\n[![DynamoDB database/sql driver](https://goreportcard.com/badge/github.com/viant/dyndb)](https://goreportcard.com/report/github.com/viant/dyndb)\n[![GoDoc](https://godoc.org/github.com/viant/dyndb?status.svg)](https://godoc.org/github.com/viant/dyndb)\n\nThis library is compatible with Go 1.17+\n\n\nPlease refer to [`CHANGELOG.md`](CHANGELOG.md) if you encounter breaking changes.\n\n\nPlease refer to [`CHANGELOG.md`](CHANGELOG.md) if you encounter breaking changes.\n\n- [DSN](#dsn-data-source-name)\n- [Usage](#usage)\n- [Benchmark](#benchmark)\n- [Bugs](#bugs)\n- [License](#License)\n- [Credits and Acknowledgements](#Credits-and-Acknowledgements)\n\n\nThis library provides fast implementation of the DynamoDB as a database/sql driver.\nFor most of the operation this driver uses PartiSQL  with ability to define custom functions.\n\n\n#### DSN Data Source Name\n\nThe Dynamodb driver accepts the following DSN\n\n* 'dynamodb://aws|{dockerEndpoint}/{region}/[{options}]'\n\n  Where queryString can optionally configure the following option:\n    - key:  access key id\n    - secret: access key secret\n    - credURL: (url encoded) local location or URL supported by  [Scy](https://github.com/viant/scy)\n    - credKey: optional (url encoded) [Scy](https://github.com/viant/scy) secret manager key or key location\n    - credID: [Scy](https://github.com/viant/scy) resource secret ID\n    - roleArn, session to use assumed role\n\n\n## Usage:\n\n\nThe following is a very simple example of query operation\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"database/sql\"\n  \"encoding/json\"\n  \"fmt\"\n  \"log\"\n  _ \"github.com/viant/dyndb\"\n  \"time\"\n)\n\ntype Publication struct {\n  ISBN      string\n  Name      string\n  IsTravel  bool\n  IsFinance bool\n}\n\nfunc main() {\n\n  db, err := sql.Open(\"dynamodb\", \"dynamodb://localhost:8000/us-west-1?key=dummy\u0026secret=dummy\")\n  if err != nil {\n    log.Fatalln(err)\n  }\n  defer db.Close()\n  SQL := `SELECT ISBN, Name,\n\t\tARRAY_EXISTS(Categories, 'TRAVEL') AS IS_TRAVEL ,\n\t\tARRAY_EXISTS(Categories, 'FINANCE') AS IS_FINANCE\n\tFROM Publication`\n\n  ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)\n  defer cancel()\n  stmt, err := db.PrepareContext(ctx, SQL)\n  if err != nil {\n    log.Fatalln(err)\n  }\n  rows, err := stmt.Query()\n  if err != nil {\n    log.Fatalln(err)\n  }\n  var records []*Publication\n  for rows.Next() {\n    record := \u0026Publication{}\n    err = rows.Scan(\u0026record.ISBN, \u0026record.Name, \u0026record.IsFinance, \u0026record.IsTravel)\n    if err != nil {\n      log.Fatalln(err)\n    }\n    records = append(records, record)\n  }\n  data, _ := json.Marshal(records)\n  fmt.Printf(\"%s\\n\", data)\n\n}\n\n```\n\n\n## Benchmark\n\nBenchmark runs times the following query:\n\n- QueryAll: (fetches 1000 records)\n```sql \n   SELECT id, state,gender,year,name, number  FROM usa_names\n```\n\n```text\nBenchmarkDatabaseSQL_QueryAll\nBenchmarkDatabaseSQL_QueryAll-16       \t      80\t  14983399 ns/op\t 1080045 B/op\t   18194 allocs/op\nBenchmarkAwsSDK_QueryAll\nBenchmarkAwsSDK_QueryAll-16            \t      54\t  19998584 ns/op\t 3654102 B/op\t   51359 allocs/op\n```\n\n\n- QuerySingle: (fetches 1 record)\n```sql \n   SELECT id, state,gender,year,name, number  FROM usa_names WHERE id = 1\n```\n```text\n  BenchmarkDatabaseSQL_QuerySingle\n  BenchmarkDatabaseSQL_QuerySingle-16    \t     726\t   1651893 ns/op\t   24465 B/op\t     333 allocs/op\n  BenchmarkAwsSDK_QuerySingle\n  BenchmarkAwsSDK_QuerySingle-16         \t     795\t   1682389 ns/op\t   29651 B/op\t     374 allocs/op\n```\n\n\n\n\nIn both case database/sql driver is faster and allocate way less memory \nthan native [AWS SDK client](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/dynamodb)\n\n\n## Bugs\n\nThis package implement only basic SQL with limited functionality. \nIt extends original PartiSQL with extra client side functionality.\nContributors are welcome.\n\n\n\u003ca name=\"License\"\u003e\u003c/a\u003e\n## License\n\nThe source code is made available under the terms of the Apache License, Version 2, as stated in the file `LICENSE`.\n\nIndividual files may be made available under their own specific license,\nall compatible with Apache License, Version 2. Please see individual files for details.\n\n\n\u003ca name=\"Credits-and-Acknowledgements\"\u003e\u003c/a\u003e\n\n##  Credits and Acknowledgements\n\n**Library Author:**\n\n**Contributors:**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviant%2Fdyndb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviant%2Fdyndb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviant%2Fdyndb/lists"}