{"id":20308628,"url":"https://github.com/joojscript/surrealdb_ex","last_synced_at":"2025-04-11T15:40:19.236Z","repository":{"id":151330422,"uuid":"621793542","full_name":"joojscript/surrealdb_ex","owner":"joojscript","description":"An Elixir Driver for Surreal DB","archived":false,"fork":false,"pushed_at":"2025-02-11T15:26:07.000Z","size":1308,"stargazers_count":26,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T09:14:02.877Z","etag":null,"topics":["database","driver","elixir","erlang","surrealdb"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/surrealdb_ex/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joojscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-03-31T11:58:15.000Z","updated_at":"2025-02-11T15:26:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"f19542b7-65cb-4d7e-b1e3-3839e9bbed6b","html_url":"https://github.com/joojscript/surrealdb_ex","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joojscript%2Fsurrealdb_ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joojscript%2Fsurrealdb_ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joojscript%2Fsurrealdb_ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joojscript%2Fsurrealdb_ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joojscript","download_url":"https://codeload.github.com/joojscript/surrealdb_ex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248432861,"owners_count":21102456,"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":["database","driver","elixir","erlang","surrealdb"],"created_at":"2024-11-14T17:23:17.803Z","updated_at":"2025-04-11T15:40:19.227Z","avatar_url":"https://github.com/joojscript.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"./.github/assets/logo.png\" alt=\"Surreal DB Elixir\" height=\"200\" /\u003e\n  \u003cbr /\u003e\n  SurrealDB EX\n\u003c/h1\u003e\n  \u003c!----\u003e  \n  \n  \u003cbr /\u003e\n \u003cp align=\"center\"\u003e\n  \u003ca href=\"#Installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#Configuration\"\u003eConfiguration\u003c/a\u003e •\n  \u003ca href=\"#Usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#Documentation\"\u003eDocumentation\u003c/a\u003e\n\u003c/p\u003e\n\n  \u003cdiv align=\"center\"\u003e\n    \u003cimg alt=\"made_with\" src=\"https://img.shields.io/badge/MADE%20WITH-ELIXIR-8700ff?style=for-the-badge\u0026logo=elixir\" /\u003e\n    \u003cimg alt=\"build_status\" src=\"https://img.shields.io/github/actions/workflow/status/joojscript/surrealdb_ex/ci.yml?style=for-the-badge\u0026color=8700ff\" /\u003e\n    \u003cimg alt=\"hex_downloads\" src=\"https://img.shields.io/hexpm/dt/surrealdb_ex?style=for-the-badge\u0026color=8700ff\" /\u003e\n    \u003cimg alt=\"open_issues\" src=\"https://img.shields.io/github/issues-raw/joojscript/surrealdb_ex?style=for-the-badge\u0026color=8700ff\" /\u003e\n    \u003cimg alt=\"version\" src=\"https://img.shields.io/hexpm/v/surrealdb_ex?color=8700ff\u0026style=for-the-badge\" /\u003e\n  \u003c/div\u003e\n  \n  \u003cbr/\u003e\n\nWelcome to the Elixir driver for SurrealDB! This library allows you to\nconnect to SurrealDB, a highly-scalable, distributed NoSQL database designed\nfor modern applications. With the Elixir driver, you can seamlessly\nintegrate SurrealDB into your Elixir projects and enjoy the benefits of a\nrobust, cloud-native database.\n\nThe Elixir driver for SurrealDB provides a simple, yet powerful API for\nworking with SurrealDB. It leverages the Erlang/Elixir ecosystem to provide\na performant and fault-tolerant connection to SurrealDB, and supports a wide\nrange of operations such as querying, inserting, updating, and deleting data.\n\nThis documentation provides a comprehensive guide to using the Elixir driver\nfor SurrealDB. It covers everything from installation and setup, to advanced\nusage scenarios and troubleshooting tips. Whether you are a seasoned Elixir\ndeveloper or new to the language, this documentation will help you get up\nand running with SurrealDB in no time.\n\nWe hope you enjoy using the Elixir driver for SurrealDB and welcome your\nfeedback and contributions. Happy coding!\n\n## Installation\n\nThe package can be installed by adding `surrealdb_ex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:surrealdb_ex, \"~\u003e 0.0.2\"}\n  ]\nend\n```\n\n## Configuration\n\nYou can set up the necessary configuration for the module under your `config/*.exs` file, in the following format:\n\n```elixir\nimport Config\n\nconfig :surrealdb_ex,\n  connection_config: [\n    hostname: \"192.168.0.114\",\n    port: 8002,\n    username: \"root\",\n    password: \"root\",\n    database: \"default\",\n    namespace: \"default\"\n  ]\n```\n\n## Usage\n\nThis driver is menat to have a easy-to-use and [design compliant](https://surrealdb.com/docs/integration/libraries/nodejs) API, here are some examples:\n\n|   | NodeJS (official supported library)   | Elixir Driver for Surreal DB  |\n|---|---|---|\n| `QUERYING` | ```await db.select(\"person\");``` | ```SurrealEx.select(\"person\")``` |\n| `INSERTING`  | ```await db.create(\"person\", {title: 'Founder \u0026 CEO', name: 'Tobie', marketing: true});```  | ```SurrealEx.create(pid, \"person\", %{title: \"Founder \u0026 CEO\", name: \"Tobie\", marketing: true})``` |\n| `UPDATING`  | ```await db.change(\"person:jaime\", {marketing: true});```  | ```SurrealEx.change(pid, \"person:jaime\", %{marketing: true})``` |\n\nAnd so much more! Basically every single function available on the official library for NodeJS*, is supported by this driver.\n\n*If there are any other implementations with different and/or better approaches, feel free to open a request for it to be added.\n\n## Additional Features to take note\n\nAll the functions available are following the format of the NodeJs client library, including the function signatures.\n\nAll functions are synchronous, if you want to run asynchronously, every functions have alternate signatures using **Tasks**, so you can control how the result will be handled when it comes. But **beware** not to fall in *deadlocks*.\n\n- Quick Example:\n\n```elixir\n  # Synchronously invoked.\n  def update(pid, table, payload)\n\n  # Accepts a %Task{} struct, which will handle the result, also some opts \n  # regarding the execution of this task. See more on the docs.\n  def update(pid, table, payload, task, opts)\n```\n\n## Running tests\n\nYou can run the full suite of tests by running the following command:\n\n```bash\nmix test\n```\n\nBut it is higly recomended to `exclude` all the **integration** tests, as they\nare going to try to connect to an actual Surreal DB instance. In the other hand,\nif you have it running (please, take note that it will insert dummy data for testing,\nbe careful). You can just override integration test configs:\n\n```elixir\nconfig :surrealdb_ex,\n  test_database_config: [\n    hostname: \"localhost\",\n    port: 8000,\n    username: \"root\",\n    password: \"root\",\n    database: \"default\",\n    namespace: \"default\"\n  ]\n```\n\n## Documentation\n\nDocumentation can be found on [HexDocs](https://hexdocs.pm/surrealdb_ex).\nAlso, the package definition on Hex.pm, can be found [here](https://hex.pm/packages/surrealdb_ex)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoojscript%2Fsurrealdb_ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoojscript%2Fsurrealdb_ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoojscript%2Fsurrealdb_ex/lists"}