{"id":13412303,"url":"https://github.com/solher/arangolite","last_synced_at":"2026-02-23T17:45:37.168Z","repository":{"id":53984833,"uuid":"43645131","full_name":"solher/arangolite","owner":"solher","description":"Lightweight Golang driver for ArangoDB","archived":false,"fork":false,"pushed_at":"2021-03-10T17:27:51.000Z","size":181,"stargazers_count":72,"open_issues_count":5,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-25T04:09:59.168Z","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/solher.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":"2015-10-04T17:27:34.000Z","updated_at":"2024-10-07T20:54:58.000Z","dependencies_parsed_at":"2022-08-13T05:40:52.649Z","dependency_job_id":null,"html_url":"https://github.com/solher/arangolite","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/solher/arangolite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solher%2Farangolite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solher%2Farangolite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solher%2Farangolite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solher%2Farangolite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solher","download_url":"https://codeload.github.com/solher/arangolite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solher%2Farangolite/sbom","scorecard":{"id":836983,"data":{"date":"2025-08-11","repo":{"name":"github.com/solher/arangolite","commit":"5401eeb0ec344e6a5b1b571eda7b96960ec0e531"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Code-Review","score":4,"reason":"Found 8/17 approved changesets -- score normalized to 4","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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 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"}},{"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"}}]},"last_synced_at":"2025-08-23T19:19:28.010Z","repository_id":53984833,"created_at":"2025-08-23T19:19:28.010Z","updated_at":"2025-08-23T19:19:28.010Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29749360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: 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.200Z","updated_at":"2026-02-23T17:45:37.139Z","avatar_url":"https://github.com/solher.png","language":"Go","funding_links":[],"categories":["Database Drivers","数据库驱动程序","数据库驱动`连接和操作数据库工具`","\u003cspan id=\"数据库驱动-database-drivers\"\u003e数据库驱动 Database Drivers\u003c/span\u003e","数据库驱动","Data Integration Frameworks","NoSQL Databases","Generators"],"sub_categories":["Advanced Console UIs","NoSQL Database Drivers","NoSQL数据库驱动程序","SQL 查询语句构建库","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# Arangolite [![Build Status](https://travis-ci.org/solher/arangolite.svg?branch=master)](https://travis-ci.org/solher/arangolite) [![Coverage Status](https://coveralls.io/repos/solher/arangolite/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/solher/arangolite?branch=master) [![Code Climate](https://codeclimate.com/github/solher/arangolite/badges/gpa.svg)](https://codeclimate.com/github/solher/arangolite) [![GoDoc](https://godoc.org/github.com/solher/arangolite?status.svg)](https://godoc.org/github.com/solher/arangolite)\n\nArangolite is a lightweight ArangoDB driver for Go.\n\nIt focuses on pure AQL querying. See [AranGO](https://github.com/diegogub/aranGO) for a more ORM-like experience.\n\n## IMPORTANT: Looking for maintainers\n\nI don't have as much time as I used to have and I am not as a frequent user of ArangoDB as I used to be. This project would definitely benefit from some new maintainers. Any PR is greatly appreciated.\n\n## Installation\n\nTo install Arangolite:\n\n    go get -u github.com/solher/arangolite/v2\n\n## Basic Usage\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"fmt\"\n  \"log\"\n\n  \"github.com/solher/arangolite/v2\"\n  \"github.com/solher/arangolite/v2/requests\"\n)\n\ntype Node struct {\n  arangolite.Document\n}\n\nfunc main() {\n  ctx := context.Background()\n\n  // We declare the database definition.\n  db := arangolite.NewDatabase(\n    arangolite.OptEndpoint(\"http://localhost:8529\"),\n    arangolite.OptBasicAuth(\"root\", \"rootPassword\"),\n    arangolite.OptDatabaseName(\"_system\"),\n  )\n\n  // The Connect method does two things:\n  // - Initializes the connection if needed (JWT authentication).\n  // - Checks the database connectivity.\n  if err := db.Connect(ctx); err != nil {\n    log.Fatal(err)\n  }\n\n  // We create a new database.\n  err := db.Run(ctx, nil, \u0026requests.CreateDatabase{\n    Name: \"testDB\",\n    Users: []map[string]interface{}{\n      {\"username\": \"root\", \"passwd\": \"rootPassword\"},\n      {\"username\": \"user\", \"passwd\": \"password\"},\n    },\n  })\n  if err != nil {\n    log.Fatal(err)\n  }\n\n  // We sign in as the new created user on the new database.\n  // We could eventually rerun a \"db.Connect()\" to confirm the connectivity.\n  db.Options(\n    arangolite.OptBasicAuth(\"user\", \"password\"),\n    arangolite.OptDatabaseName(\"testDB\"),\n  )\n\n  // We create a new \"nodes\" collection.\n  if err := db.Run(ctx, nil, \u0026requests.CreateCollection{Name: \"nodes\"}); err != nil {\n    log.Fatal(err)\n  }\n\n  // We declare a new AQL query with options and bind parameters.\n  key := \"48765564346\"\n  r := requests.NewAQL(`\n    FOR n\n    IN nodes\n    FILTER n._key == @key\n    RETURN n\n  `, key).\n    Bind(\"key\", key).\n    Cache(true).\n    BatchSize(500) // The caching feature is unavailable prior to ArangoDB 2.7\n\n  // The Run method returns all the query results of every pages\n  // available in the cursor and unmarshal it into the given struct.\n  // Cancelling the context cancels every running request. \n  nodes := []Node{}\n  if err := db.Run(ctx, \u0026nodes, r); err != nil {\n    log.Fatal(err)\n  }\n\n  // The Send method gives more control to the user and doesn't follow an eventual cursor.\n  // It returns a raw result object.\n  result, err := db.Send(ctx, r)\n  if err != nil {\n    log.Fatal(err)\n  }\n  nodes = []Node{}\n  result.UnmarshalResult(\u0026nodes)\n\n  for result.HasMore() {\n    result, err = db.Send(ctx, \u0026requests.FollowCursor{Cursor: result.Cursor()})\n    if err != nil {\n      log.Fatal(err)\n    }\n    tmp := []Node{}\n    result.UnmarshalResult(\u0026tmp)\n\n    nodes = append(nodes, tmp...)\n  }\n\n  fmt.Println(nodes)\n}\n```\n\n## Document and Edge\n\n```go\n// Document represents a basic ArangoDB document\ntype Document struct {\n  // The document handle. Format: ':collection/:key'\n  ID string `json:\"_id,omitempty\"`\n  // The document's revision token. Changes at each update.\n  Rev string `json:\"_rev,omitempty\"`\n  // The document's unique key.\n  Key string `json:\"_key,omitempty\"`\n}\n\n// Edge represents a basic ArangoDB edge\ntype Edge struct {\n  Document\n  // Reference to another document. Format: ':collection/:key'\n  From string `json:\"_from,omitempty\"`\n  // Reference to another document. Format: ':collection/:key'\n  To string `json:\"_to,omitempty\"`\n}\n```\n\n## Transactions\n### Overview\n\nArangolite provides an abstraction layer to the Javascript ArangoDB transactions.\n\nThe only limitation is that no Javascript processing can be manually added inside the transaction. The queries can be connected using the Go templating conventions.\n\n### Usage\n\n```go\nt := requests.NewTransaction([]string{\"nodes\"}, nil).\n  AddAQL(\"nodes\", `\n    FOR n\n    IN nodes\n    RETURN n\n`).\n  AddAQL(\"ids\", `\n    FOR n\n    IN {{.nodes}}\n    RETURN n._id\n`).\n  Return(\"ids\")\n\nids := []string{}\nif err := db.Run(ctx, ids, t); err != nil {\n  log.Fatal(err)\n}\n```\n\n## Graphs\n### Overview\n\nAQL may be used for querying graph data. But to manage graphs, Arangolite offers a few specific requests:\n\n- `CreateGraph` to create a graph.\n- `ListGraphs` to list available graphs.\n- `GetGraph` to get an existing graph.\n- `DropGraph` to delete a graph.\n\n### Usage\n\n```go\n// Check graph existence.\nif err := db.Run(ctx, nil, \u0026requests.GetGraph{Name: \"graphName\"}); err != nil {\n  switch {\n  case arangolite.IsErrNotFound(err):\n    // If graph does not exist, create a new one.\n    edgeDefinitions := []requests.EdgeDefinition{\n      {\n        Collection: \"edgeCollectionName\",\n        From:       []string{\"firstCollectionName\"},\n        To:         []string{\"secondCollectionName\"},\n      },\n    }\n    db.Run(ctx, nil, \u0026requests.CreateGraph{Name: \"graphName\", EdgeDefinitions: edgeDefinitions})\n  default:\n    log.Fatal(err)\n  }\n}\n\n// List existing graphs.\nlist := \u0026requests.GraphList{}\ndb.Run(ctx, list, \u0026requests.ListGraphs{})\nfmt.Printf(\"Graph list: %v\\n\", list)\n\n// Destroy the graph we just created, and the related collections.\ndb.Run(ctx, nil, \u0026requests.DropGraph{Name: \"graphName\", DropCollections: true})\n```\n\n## Error Handling\n\nErrors can be handled using the provided basic testers:\n\n```go\n// IsErrInvalidRequest returns true when the database returns a 400.\nfunc IsErrInvalidRequest(err error) bool {\n  return HasStatusCode(err, 400)\n}\n\n// IsErrUnauthorized returns true when the database returns a 401.\nfunc IsErrUnauthorized(err error) bool {\n  return HasStatusCode(err, 401)\n}\n\n// IsErrForbidden returns true when the database returns a 403.\nfunc IsErrForbidden(err error) bool {\n  return HasStatusCode(err, 403)\n}\n\n// IsErrUnique returns true when the error num is a 1210 - ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.\nfunc IsErrUnique(err error) bool {\n  return HasErrorNum(err, 1210)\n}\n\n// IsErrNotFound returns true when the database returns a 404 or when the error num is:\n// 1202 - ERROR_ARANGO_DOCUMENT_NOT_FOUND\n// 1203 - ERROR_ARANGO_COLLECTION_NOT_FOUND\nfunc IsErrNotFound(err error) bool {\n  return HasStatusCode(err, 404) || HasErrorNum(err, 1202, 1203)\n}\n\n```\n\nOr manually via the `HasStatusCode` and `HasErrorNum` methods.\n\n## Contributing\n\nCurrently, very few methods of the ArangoDB HTTP API are implemented in Arangolite.\nFortunately, it is really easy to add your own by implementing the `Runnable` interface.\nYou can then use the regular `Run` and `Send` methods.\n\n```go\n// Runnable defines requests runnable by the Run and Send methods.\n// A Runnable library is located in the 'requests' package.\ntype Runnable interface {\n  // The body of the request.\n  Generate() []byte\n  // The path where to send the request.\n  Path() string\n  // The HTTP method to use.\n  Method() string\n}\n```\n\n**Please pull request when you implement some new features so everybody can use it.**\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolher%2Farangolite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolher%2Farangolite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolher%2Farangolite/lists"}