https://github.com/grottohub/carpenter
Bindings for Erlang's ETS tables. Forked and updated from gts.
https://github.com/grottohub/carpenter
Last synced: 5 months ago
JSON representation
Bindings for Erlang's ETS tables. Forked and updated from gts.
- Host: GitHub
- URL: https://github.com/grottohub/carpenter
- Owner: grottohub
- Created: 2024-03-29T03:03:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-08T14:25:02.000Z (over 1 year ago)
- Last Synced: 2025-05-06T11:08:02.199Z (5 months ago)
- Language: Gleam
- Size: 21.5 KB
- Stars: 24
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-gleam - carpenter - [📚](https://hexdocs.pm/carpenter/) - Bindings for Erlang's ETS tables. Forked and updated from gts. (Packages / Erlang and OTP)
README
# carpenter 🔨
[](https://hex.pm/packages/carpenter)
[](https://hexdocs.pm/carpenter/)Bindings for Erlang's [ETS tables](https://www.erlang.org/doc/man/ets.html). Forked and updated from [gts](https://github.com/Lunarmagpie/gts).
If you aren't familiar with ETS tables, [this](https://elixirschool.com/en/lessons/storage/ets) is a good introduction.
## Quick start
```gleam
import gleam/io
import carpenter/tablepub 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:
```sh
gleam add carpenter
```Its documentation can be found at .