Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
/ carpenter Public archive
forked from grottohub/carpenter

Bindings for Erlang's ETS tables. Forked and updated from gts.

Notifications You must be signed in to change notification settings

leah-u/carpenter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

carpenter 🔨

Package Version Hex Docs

Bindings for Erlang's ETS tables. Forked and updated from gts.

If you aren't familiar with ETS tables, this is a good introduction.

Quick start

import gleam/io
import carpenter/table

pub fn main() {
  // Set up and configure an ETS table
  let assert Ok(example) =
    table.build("table_name")
    |> table.privacy(table.Private)
    |> table.write_concurrency(table.AutoWriteConcurrency)
    |> table.read_concurrency(True)
    |> table.decentralized_counters(True)
    |> table.compression(False)
    |> table.set

  // Insert a value
  example
  |> table.insert([#("hello", "world")])

  // Retrieve a key-value tuple
  example
  |> table.lookup("hello")
  |> io.debug

  // Delete an object
  example
  |> table.delete("hello")

  // Delete a table
  example
  |> table.drop
}

Installation

This package is available on hex:

gleam add carpenter

Its documentation can be found at https://hexdocs.pm/carpenter.

About

Bindings for Erlang's ETS tables. Forked and updated from gts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Gleam 98.3%
  • Erlang 1.7%