{"id":13412307,"url":"https://github.com/viant/asc","last_synced_at":"2025-08-03T13:31:10.997Z","repository":{"id":57491747,"uuid":"61067049","full_name":"viant/asc","owner":"viant","description":"Datastore Connectivity for Aerospike for go","archived":false,"fork":false,"pushed_at":"2024-08-09T12:49:02.000Z","size":82,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-09T13:54:57.041Z","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:22:31.000Z","updated_at":"2024-08-09T12:49:05.000Z","dependencies_parsed_at":"2024-10-26T08:35:59.150Z","dependency_job_id":"e5ba9199-e401-49f4-8d22-0bc939d800dc","html_url":"https://github.com/viant/asc","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fasc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fasc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fasc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viant%2Fasc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viant","download_url":"https://codeload.github.com/viant/asc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228547504,"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:23.256Z","updated_at":"2024-12-07T01:26:22.927Z","avatar_url":"https://github.com/viant.png","language":"Go","readme":"# Datastore Connectivity for Aerospike (asc)\n\n\n[![Datastore Connectivity library for Aerospike in Go.](https://goreportcard.com/badge/github.com/viant/asc)](https://goreportcard.com/report/github.com/viant/asc)\n[![GoDoc](https://godoc.org/github.com/viant/asc?status.svg)](https://godoc.org/github.com/viant/asc)\n\nThis library is compatible with Go 1.11+\n\n\nPlease refer to [`CHANGELOG.md`](CHANGELOG.md) if you encounter breaking changes.\n\n- [Usage](#Usage)\n- [License](#License)\n- [Credits and Acknowledgements](#Credits-and-Acknowledgements)\n\n\n#### Configuration parameters\n\n###### aerospike client/policy config params\n - timeoutMs\n - connectionTimeout\n - serverSocketTimeout\n - scanPct\n - host\n - port\n - namespace\n - sleepBetweenRetries\n - batchSize\n \n \n###### keyColumn, keyColumnName\n \nDefines name of column used as record key ('id' by default)\n\nIt can be specified per table i.e\n\n    events.keyColumn = code\n    \n\n###### excludedColumns\n\nList of columns to be excluded from record (i.e: id - in case we need it only as record key)\n\n\n###### dateFormat\n\nISO date format used to time.Time conversion\n\n\n###### optimizeLargeScan\n\nExperimental feature that first scan all keys and write then to disk\nand then separate go routines scan data using the dumped keys\n\nYou can only specify _scanBaseDirectory_\n\n\n## Usage:\n\n\nThe following is a very simple example of CRUD operations with dsc\n\nconfig.yaml\n```yaml\ndriverName: aerospike\nparameters:\n  namespace: test\n  host: 127.0.0.1\n  dateFormat: yyyy-MM-dd hh:mm:ss\n```\n\n```go\npackage main\n\nimport (\n    _ \"github.com/aerospike/aerospike-client-go\"\n    _ \"github.com/viant/asc\"\n    \"github.com/viant/dsc\"\n    \"log\"\n)\n\n\ntype Interest struct {\n\tId int\t`autoincrement:\"true\"`\n\tName string\n\tExpiryTimeInSecond int `column:\"expiry\"`\n\tCategory string\n}\n\n\nfunc main() {\n\n\n\tconfig, err := dsc.NewConfigFromURL(\"config.yaml\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfactory := dsc.NewManagerFactory()\n\tmanager, err := factory.Create(config)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\n\n  \t// manager := factory.CreateFromURL(\"file:///etc/myapp/datastore.json\")\n  \n    interest := \u0026Interest{}\n    \n    success, err:= manager.ReadSingle(interest, \"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 intersts = make([]*Interest, 0)\n    err = manager.ReadAll(\u0026intersts, \"SELECT id, name, expiry, category FROM interests\", nil ,nil)\n    if err != nil {\n        panic(err.Error())\n    }\n\n    \n    intersts = []*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\t_, _, err = manager.PersistAll(\u0026intersts, \"intersts\", nil)\n\tif err != nil {\n        panic(err.Error())\n   \t}\n   \tfmt.Printf(\"Inserted %v, updated: %v\\n\", inserted, updated)\n  \n    deleted, err := manager.DeleteAll(\u0026intersts, \"intersts\", nil)\n    if err != nil {\n        panic(err.Error())\n   \t}\n \tfmt.Printf(\"Inserted %v, updated: %v\\n\", deleted)\n\n\n \t\n \tvar records = []map[string]interface{}{}\n \t err = manager.ReadAll(\u0026records, \"SELECT id, name, expiry, category FROM interests\", nil ,nil)\n    if err != nil {\n        panic(err.Error())\n    }\n}\n```\n\n\n### Query level UDF support\n\n- **ARRAY** converts supplied source column into collection of map entry defined as (key, value) \n\n```sql\nSELECT \n  id, \n  username, \nARRAY(city_visited) AS visited\nFROM users\n```\n\n\n- **JSON**  convert supplied source column to JSON\n```sql\nSELECT \n  id, \n  username, \nJSON(city_visited) AS visited\nFROM users\n```\n\n## GoCover\n\n[![GoCover](https://gocover.io/github.com/viant/asc)](https://gocover.io/github.com/viant/asc)\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:**","funding_links":[],"categories":["数据库驱动","Database Drivers","NoSQL Databases","Generators","数据库驱动程序","数据库驱动`连接和操作数据库工具`","Data Integration Frameworks","數據庫驅動","\u003cspan id=\"数据库驱动-database-drivers\"\u003e数据库驱动 Database Drivers\u003c/span\u003e"],"sub_categories":["SQL 查询语句构建库","NoSQL Database Drivers","Advanced Console UIs","NoSQL数据库驱动程序","高级控制台界面","高級控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviant%2Fasc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviant%2Fasc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviant%2Fasc/lists"}