Navigation Menu

Skip to content

Nguyen-Hoang-Nam/immudb-elixir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Immudb Elixir

The implementation of Immudb client in Elixir.

Installation

def deps do
  [
    {:immudb_elixir, "~> 0.2.0"}
  ]
end

Usage

Connecting to Immudb

You can connect to Immudb in 2 ways

{:ok, immudb} = Immudb.new(
    host: host,
    port: port,
    username: username,
    password: password,
    database: database
)
{:ok, immudb} = Immudb.new(
    url: "immudb://user:pass@host:port/dbname"
)

Key value

Set key and value

immudb
|> Immudb.set("Hello", "World")

Get value from key

immudb
|> Immudb.get("Hello")

Set with verification

immudb
|> Immudb.verified_set("Hello", "World")

Get with verification

immudb
|> Immudb.verified_get("Hello")

SQL

Execute sql (create, insert)

immudb
|> Immudb.sql_exec("CREATE TABLE hello (id INTEGER, name VARCHAR, PRIMARY KEY id)")
immudb
|> Immudb.sql_exec("INSERT INTO hello (id, name) VALUES (@id, @name)", %{id: 1, name: "World"})

Query table

immudb
|> Immudb.sql_query("SELECT * FROM hello WHERE id == @id", %{id: 1})

TODO

  • update_auth_config
  • update_mtls_config
  • exec_all
  • z_add
  • verifiable_z_add
  • z_scan
  • stream
  • Test sql command

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Apache License 2.0

About

Elixir client for ImmuDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages