{"id":13412217,"url":"https://github.com/viant/dsc","last_synced_at":"2025-08-03T13:31:06.311Z","repository":{"id":57491755,"uuid":"61066818","full_name":"viant/dsc","owner":"viant","description":"Datastore Connectivity in go","archived":false,"fork":false,"pushed_at":"2024-05-25T20:01:58.000Z","size":373,"stargazers_count":32,"open_issues_count":1,"forks_count":11,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-07-31T20:50:02.257Z","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":"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-13T20:18:10.000Z","updated_at":"2024-06-20T01:46:36.000Z","dependencies_parsed_at":"2024-06-18T18:35:48.361Z","dependency_job_id":"7229cb29-6172-4b4a-a8d6-de1fd4bf60bd","html_url":"https://github.com/viant/dsc","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fdsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viant","download_url":"https://codeload.github.com/viant/dsc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228547512,"owners_count":17935093,"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":[],"created_at":"2024-07-30T20:01:22.230Z","updated_at":"2024-12-07T01:26:25.699Z","avatar_url":"https://github.com/viant.png","language":"Go","readme":"# Datastore Connectivity (dsc)\n\n[![Datastore Connectivity library for Go.](https://goreportcard.com/badge/github.com/viant/dsc)](https://goreportcard.com/report/github.com/viant/dsc)\n[![GoDoc](https://godoc.org/github.com/viant/dsc?status.svg)](https://godoc.org/github.com/viant/dsc)\n\nThis library is compatible with Go 1.10+\n\nPlease refer to [`CHANGELOG.md`](CHANGELOG.md) if you encounter breaking changes.\n\n- [Motivation](#Motivation)\n- [Usage](#Usage)\n- [Prerequisites](#Prerequisites)\n- [Installation](#Installation)\n- [API Documentaion](#API-Documentation)\n- [Tests](#Tests)\n- [Examples](#Examples)\n- [License](#License)\n- [Credits and Acknowledgements](#Credits-and-Acknowledgements)\n\n\n\n## Motivation\n\nThis library was developed as part of dsunit (Datastore unit testibility library) to provide unified access to SQL, noSQL, \nor any other store that deals with structured data in SQL-ish way.\n\n\n## Usage:\n\n\nThe following is a very simple example of CRUD operations with dsc\n\n```go\npackage main\n\nimport (\n)\n\n\nfunc main() {\n\n\n\tconfig := dsc.NewConfig(\"mysql\", \"[user]:[password]@[url]\", \"user:root,password:dev,url:tcp(127.0.0.1:3306)/mydb?parseTime=true\")\n\tfactory := NewManagerFactory()\n\tmanager, err := factory.Create(config)\n    if err != nil {\n        panic(err.Error())\n\t}\n\n    // manager := factory.CreateFromURL(\"file:///etc/myapp/datastore.json\")\n  \n  \n    interest := Interest{}\n    \n    success, err:= manager.ReadSingle(\u0026interest, \"SELECT id, name, expiry, category FROM interests WHERE id = ?\", []interface{}{id},nil)\n\tif err != nil {\n        panic(err.Error())\n\t}\n\n    var interests = make([]Interest, 0)\n    err:= manager.ReadAll(\u0026interests, \"SELECT id, name, expiry, category FROM interests\", nil ,nil)\n    if err != nil {\n        panic(err.Error())\n    }\n\n    fmt.Printf(\"all interests: %v\\n\", interests)\n\n    interests = []Interest {\n        Interest{Name:\"Abc\", ExpiryTimeInSecond:3600, Category:\"xyz\"},\n        Interest{Name:\"Def\", ExpiryTimeInSecond:3600, Category:\"xyz\"},\n        Interest{Id:20, Name:\"Ghi\", ExpiryTimeInSecond:3600, Category:\"xyz\"},\n    }\n\n\n\tinserted, updated, err:= manager.PersistAll(\u0026interests, \"interests\", nil)\n\tif err != nil {\n        panic(err.Error())\n   \t}\n    deleted, err := manager.DeleteAll(\u0026interests, \"interests\", nil)\n    if err != nil {\n        panic(err.Error())\n   \t}\n \tfmt.Printf(\"Inserted %v, updated: %v, deleted: %v\\n\", inserted, updated, deleted)\n  \n}\n```\n\nMore examples illustrating the use of the API are located in the\n[`examples`](examples) directory.\n\nDetails about the API are available in the [`docs`](docs) directory.\n\n\u003ca name=\"Prerequisites\"\u003e\u003c/a\u003e\n## Prerequisites\n\n[Go](http://golang.org) version v1.5+ is required.\n\nTo install the latest stable version of Go, visit\n[http://golang.org/dl/](http://golang.org/dl/)\n\n\nTarget\n\n\n\u003ca name=\"Installation\"\u003e\u003c/a\u003e\n## Installation:\n\n1. Install Go 1.5+ and setup your environment as [Documented](http://golang.org/doc/code.html#GOPATH) here.\n2. Get the client in your ```GOPATH``` : ```go get github.com/viant/dsc```\n * To update the client library: ```go get -u github.com/viant/dsc```\n\n\n### Some Hints:\n\n * To run a go program directly: ```go run \u003cfilename.go\u003e```\n * to build:  ```go build -o \u003coutput\u003e \u003cfilename.go\u003e```\n\n\n\n\u003ca name=\"API-Documentation\"\u003e\u003c/a\u003e\n\n## API Documentation\n\nAPI documentation is available in the [`docs`](docs/README.md) directory.\n\n\n## Tests\n\nThis library is packaged with a number of tests. Tests require Testify library.\n\nBefore running the tests, you need to update the dependencies:\n\n    $ go get .\n\nTo run all the test cases with race detection:\n\n    $ go test\n\n\n\n\u003ca name=\"Examples\"\u003e\u003c/a\u003e\n## Examples\n\nA simple CRUD applications is provided in the [`examples`](examples) directory.\n\n\n## GoCover\n\n[![GoCover](http://gocover.io/github.com/viant/dsc)](http://gocover.io/github.com/viant/dsc)\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:** Adrian Witas\n\n**Contributors:** Sudhakaran Dharmaraj\n","funding_links":[],"categories":["Database Drivers","\u003cspan id=\"数据库驱动-database-drivers\"\u003e数据库驱动 Database Drivers\u003c/span\u003e","NoSQL Databases","Generators","数据库驱动","Data Integration Frameworks","数据库驱动`连接和操作数据库工具`","数据库驱动程序","數據庫驅動"],"sub_categories":["Advanced Console UIs","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","Interfaces to Multiple Backends","高级控制台界面","SQL 查询语句构建库","多个后端接口","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviant%2Fdsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviant%2Fdsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviant%2Fdsc/lists"}