Skip to content

flambard/postgrex_erlang_term

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgrexErlangTerm

Postgrex extension and Ecto type ErlangTerm for use with the PostgreSQL extension pg_erlang_term for sending and storing arbitrary Erlang/Elixir terms efficiently as binaries while still being human-readable in SQL.

Installation

If available in Hex, the package can be installed by adding postgrex_erlang_term to your list of dependencies in mix.exs:

def deps do
  [
    {:postgrex_erlang_term, "~> 0.1.0"}
  ]
end

Add PostgrexErlangTerm.PostgresTypes to your Ecto repo config:

types: PostgrexErlangTerm.PostgresTypes

Usage

In Ecto migrations, use :erlang_term as type on columns like so:

create table(:some_table) do
  add :some_column, :erlang_term
end

On Ecto schemas, use the ErlangTerm type:

alias PostgrexErlangTerm.ErlangTerm

schema "some_table" do
  field :some_column, ErlangTerm
end

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages