{"id":42206246,"url":"https://github.com/go-surreal/sdbc","last_synced_at":"2026-01-27T00:34:40.026Z","repository":{"id":195371401,"uuid":"687570869","full_name":"go-surreal/sdbc","owner":"go-surreal","description":"An independent go client for the awesome SurrealDB.","archived":false,"fork":false,"pushed_at":"2025-12-28T05:33:30.000Z","size":245,"stargazers_count":11,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T12:19:16.855Z","etag":null,"topics":["client","database","golang","graph","lib","library","package","pkg","sql","surrealdb"],"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/go-surreal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-05T16:16:54.000Z","updated_at":"2025-12-04T09:41:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"3254f01c-7b1c-4f87-8cf2-a6de772eba66","html_url":"https://github.com/go-surreal/sdbc","commit_stats":null,"previous_names":["go-surreal/sdbc"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/go-surreal/sdbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-surreal%2Fsdbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-surreal%2Fsdbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-surreal%2Fsdbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-surreal%2Fsdbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-surreal","download_url":"https://codeload.github.com/go-surreal/sdbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-surreal%2Fsdbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28793508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"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":["client","database","golang","graph","lib","library","package","pkg","sql","surrealdb"],"created_at":"2026-01-27T00:34:39.301Z","updated_at":"2026-01-27T00:34:40.017Z","avatar_url":"https://github.com/go-surreal.png","language":"Go","readme":"\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg width=\"300px\" src=\".github/branding/logo.svg\" alt=\"logo\"\u003e\n    \u003ch3\u003eAn independent SurrealDB client for Go\u003c/h3\u003e\n\u003c/div\u003e\n\n\u003chr /\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/go-surreal/sdbc/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/go-surreal/sdbc\" alt=\"release\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://go.dev/doc/devel/release\"\u003e\u003cimg src=\"https://img.shields.io/github/go-mod/go-version/go-surreal/sdbc?label=go\" alt=\"go version\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://goreportcard.com/report/github.com/go-surreal/sdbc\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/go-surreal/sdbc\" alt=\"go report card\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://github.com/go-surreal/sdbc/actions/workflows/tests_codecov.yml\"\u003e\u003cimg src=\"https://github.com/go-surreal/sdbc/actions/workflows/tests_codecov.yml/badge.svg?branch=main\" alt=\"tests\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://codecov.io/gh/go-surreal/sdbc\"\u003e\u003cimg src=\"https://codecov.io/gh/go-surreal/sdbc/graph/badge.svg?token=AMR12YX5XU\" alt=\"codecov\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://discord.gg/surrealdb\"\u003e\u003cimg src=\"https://img.shields.io/discord/902568124350599239?label=discord\u0026color=5a66f6\" alt=\"discord\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003cimg src=\"https://img.shields.io/github/contributors/go-surreal/sdbc\" alt=\"contributors\"\u003e\n\u003c/p\u003e\n\nSDBC (**S**urreal**DB** **C**lient) is an independent Go client for the innovative [SurrealDB](https://surrealdb.com/) multi-model database system.\n\n**DISCLAIMER**: SDBC is not the official Go client for SurrealDB but rather an independent implementation.\nYou can find the repository for the official implementation [here](https://github.com/surrealdb/surrealdb.go).\nCurrently, SDBC is designed for direct use with [SOM](https://github.com/go-surreal/som).\nIt's important to note that SDBC is in the early stages of development and is not yet stable or ready for production use.\n\n## Table of Contents\n\n- [What is SurrealDB?](#what-is-surrealdb)\n- [Why SDBC instead of the official client?](#why-sdbc-instead-of-the-official-client)\n- [Features](#features)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n## What is SurrealDB?\n\nSurrealDB is a cutting-edge database system that offers a SQL-style query language with real-time queries  \nand efficient related data retrieval. It supports both schema-full and schema-less data handling.\nWith its full graph database functionality, SurrealDB enables advanced querying and analysis by allowing \nrecords (or vertices) to be connected with edges, each with its own properties and metadata. \nThis facilitates multi-table, multi-depth document retrieval without complex JOINs, all within the database.\n\n*(Information extracted from the [official homepage](https://surrealdb.com))*.\n\n## Why SDBC instead of the official client?\n\nThe official client can be found [here](https://github.com/surrealdb/surrealdb.go).\n\n- The official Go client for SurrealDB is currently not in a really usable state.\n- Inconsistencies exist in the codebase, such as the unused `url` parameter in the `New` function.\n- It lacks essential features, particularly after both the 1.0 (first stable) and 2.0 releases of SurrealDB.\n- The SurrealDB team has other priorities, and it seems as if they are currently not actively maintaining the Go client.\n- Future versions of the official client may require CGO for direct bindings to an underlying driver, whereas SDBC will always be pure Go.\n- Writing this custom client was and is an enjoyable endeavor 😉\n\nSDBC is a practical choice until the official client becomes stable, actively maintained, and supports\nall the features required by SOM. It also maintains purity in Go and avoids CGO dependencies.\n\nIt is still open whether this project will be maintained after the official client becomes stable\nand usable for SOM.\n\n## Features\n\n- Pure Go implementation without CGO dependencies.\n- Supports schema-full and schema-less data handling.\n- Enables advanced querying and analysis with full graph database functionality.\n- Designed for direct use with [SOM](https://github.com/go-surreal/som).\n\n### Details\n\n#### Supported operations\n\nThis client implements the [RPC (websocket) interface](https://surrealdb.com/docs/surrealdb/integration/rpc) of SurrealDB.\nThe following operations are supported:\n\n| Function                            | Description                                                                                              | Supported         |\n|-------------------------------------|----------------------------------------------------------------------------------------------------------|-------------------|\n| use [ ns, db ]                      | Specifies or unsets the namespace and/or database for the current connection                             | ✅                 |\n| info                                | Returns the record of an authenticated record user                                                       | ❌ (no\u0026nbsp;need)  |\n| version                             | Returns version information about the database/server                                                    | ✅                 |\n| signup  [ NS, DB, AC, … ]           | Signup a user using the SIGNUP query defined in a record access method                                   | ❌ (no\u0026nbsp;need)  |\n| signin   [NS, DB, AC, … ]           | Signin a root, NS, DB or record user against SurrealDB                                                   | ✅                 |\n| authenticate [ token ]              | Authenticate a user against SurrealDB with a token                                                       | ❌ (no\u0026nbsp;need)  |\n| invalidate                          | Invalidate a user’s session for the current connection                                                   | ❌ (no\u0026nbsp;need)  |\n| let [ name, value ]                 | Define a variable on the current connection                                                              | ✅                 |\n| unset [ name ]                      | Remove a variable from the current connection                                                            | ✅                 |\n| live [ table, diff ]                | Initiate a live query                                                                                    | ✅                 |\n| kill [ queryUuid ]                  | Kill an active live query                                                                                | ✅                 |\n| query [ sql, vars ]                 | Execute a custom query with optional variables                                                           | ✅                 |\n| graphql [ query, options? ]         | Execute GraphQL queries against the database                                                             | ⚠️ (not\u0026nbsp;yet) |\n| run [ func_name, version, args ]    | Execute built-in functions, custom functions, or machine learning models with optional arguments.        | ✅                 |\n| select [ thing ]                    | Select either all records in a table or a single record                                                  | ✅                 |\n| create [ thing, data ]              | Create a record with a random or specified ID                                                            | ✅                 |\n| insert [ thing, data ]              | Insert one or multiple records in a table                                                                | ✅                 |\n| insert_relation [ table, data ]     | Insert a new relation record into a specified table or infer the table from the data                     | ✅                 |\n| update [ thing, data ]              | Modify either all records in a table or a single record with specified data if the record already exists | ✅                 |\n| upsert [ thing, data ]              | Replace either all records in a table or a single record with specified data                             | ✅                 |\n| relate [ in, relation, out, data? ] | Create graph relationships between created records                                                       | ✅                 |\n| merge [ thing, data ]               | Merge specified data into either all records in a table or a single record                               | ✅                 |\n| patch [ thing, patches, diff ]      | Patch either all records in a table or a single record with specified patches                            | ✅                 |\n| delete [ thing ]                    | Delete either all records in a table or a single record                                                  | ✅                 |\n\n#### Supported data types\n\nThis client supports the following [data types](https://surrealdb.com/docs/surrealql/datamodel#data-types) as defined by SurrealDB:\n\n| Type     | Description                                                                                                                                                            | Definition                                                      | Supported            | Go type                                  |\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|----------------------|------------------------------------------|\n| any      | The field will allow any data type supported by SurrealDB.                                                                                                             | (see others)                                                    | ✅                    | any                                      |\n| array    | An array of items. Content and length can be defined.                                                                                                                  | array, array\u003cstring\u003e, array\u003cint, 10\u003e                            | ✅                    | []any                                    |\n| bool     | Describes whether something is truthy or not.                                                                                                                          | true, false                                                     | ✅                    | bool                                     |\n| bytes    | Stores a value in a byte array.                                                                                                                                        | bytes, \u003cbytes\u003evalue                                             | ✅                    | []byte                                   |\n| datetime | An ISO 8601 compliant data type that stores a date with time and time zone.                                                                                            | (ISO 8601)                                                      | ✅                    | time.Time                                |\n| decimal  | Uses BigDecimal for storing any real number with arbitrary precision.                                                                                                  | -                                                               | ✅                    | float64                                  |\n| duration | Store a value representing a length of time.                                                                                                                           | 1h, 1m, 1h1m1s                                                  | ✅                    | time.Duration                            |\n| float    | Store a value in a 64 bit float.                                                                                                                                       | 1.5, 100.3                                                      | ✅                    | float32, float64                         |\n| geometry | RFC 7946 compliant data type for storing geometry in the GeoJson format.                                                                                               | [(see below)](#supported-geometry-types)                        | ⚠️\u0026nbsp;not\u0026nbsp;yet | [(see below)](#supported-geometry-types) |\n| int      | Store a value in a 64 bit integer.                                                                                                                                     | 1, 2, 3, 4                                                      | ✅                    | int                                      |\n| number   | Store numbers without specifying the type. SurrealDB will store it using the minimal number of bytes.                                                                  | -                                                               | ✅                    | int, float, ...                          |\n| none     | ?                                                                                                                                                                      | -                                                               | ❌                    | -                                        |\n| object   | Store formatted objects containing values of any supported type with no limit to object depth or nesting.                                                              | -                                                               | ✅                    | struct{ ... }, `map[comparable]any`      |\n| literal  | A value that may have multiple representations or formats, similar to an enum or a union type.\u003cbr\u003eCan be composed of strings, numbers, objects, arrays, or durations.  | \"a\" \\| \"b\", \\[number, “abc”\\], 123   \\| 456 \\| string \\| 1y1m1d | ⚠️\u0026nbsp;kind\u0026nbsp;of | (any)                                    |\n| option   | Makes types optional and guarantees the field to be either empty (NULL) or a value.                                                                                    | option\u003c...\u003e                                                     | ✅                    | * (pointer)                              |\n| range    | A range of possible values. Lower and upper bounds can be set, in the absence of which the range\u003cbr\u003ebecomes open-ended. A range of integers can be used in a FOR loop. | 0..10, 0..=10, ..10, 'a'..'z'                                   | ❌                    |                                          |\n| record   | Store a reference to another record. The value must be a Record ID.                                                                                                    | record, record\u003cuser\u003e, record\u003cuser \\| administrator\u003e             | ✅                    | *sdbc.ID                                 |\n| set      | A set of items. Similar to array, but items are automatically deduplicated.                                                                                            | set, set\u003cstring\u003e, set\u003cint, 10\u003e                                  | ✅                    | []any                                    |\n| string   | Describes a text-like value.                                                                                                                                           | \"some\", \"value\"                                                 | ✅                    | string                                   |\n\n#### Supported geometry types\n\nThese types are not yet implemented.\n\n## Getting Started\n\n### Installation\n\nTo install SDBC, run the following command:\n\n```bash\ngo get github.com/go-surreal/sdbc\n```\n\n### Usage\n\nTo use SDBC, import it in your Go code:\n\n```go\nimport (\n\t\"github.com/go-surreal/sdbc\"\n)\n```\n\nThen, create a new client:\n\n```go\nfunc main() {\n\tclient, err := sdbc.NewClient(ctx, sdbc.Config{\n\t\tAddress:   \"ws://localhost:8000/rpc\", \n\t\tUsername:  \"root\", \n\t\tPassword:  \"root\", \n\t\tNamespace: \"test\",\n\t\tDatabase:  \"test\",\n\t})\n\t\n\tif err != nil {\n        log.Fatal(err)\n    }\n\t\t\n    // ...\n}\n```\n\n## Contributing\n\nWe welcome contributions! If you'd like to contribute to SDBC, please read our\n[Contributing Guidelines](https://github.com/go-surreal/sdbc/blob/main/CONTRIBUTING.md)\nfor instructions on how to get started.\n\n## License\n\nSDBC is licensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-surreal%2Fsdbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-surreal%2Fsdbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-surreal%2Fsdbc/lists"}