Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Marmot
https://maxpert.github.io/marmot
Admin
Marmot is a distributed SQLite replicator built on top of NATS.
Tokens:
567
Snippets:
7
Trust Score:
8.3
Update:
1 year ago
Context
Chat
Benchmark
50
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Run Marmot Cluster Example Source: https://maxpert.github.io/marmot/intro This script initiates a Marmot cluster using the provided example configuration. It's a convenient way to set up a test environment for Marmot. ```bash ./examples/run-cluster.sh ``` -------------------------------- ### Marmot Configuration for Primary/Replica Setup Source: https://maxpert.github.io/marmot/intro This example shows TOML configuration for Marmot to manage primary and replica nodes. The `publish` flag controls local change replication, and `replicate` controls replication from NATS. ```toml # For primary node: publish = true replicate = false # For replica node: publish = false replicate = true ``` -------------------------------- ### Database Cleanup with Marmot CLI Source: https://maxpert.github.io/marmot/intro This command initiates a database cleanup process using Marmot. It requires a configuration file path. The cleanup removes hooks and log tables. ```bash marmot -config /path/to/config.toml -cleanup ``` -------------------------------- ### Insert Data into SQLite Database Source: https://maxpert.github.io/marmot/intro This snippet demonstrates how to insert data into an SQLite database using the `sqlite3` command-line interface. It shows a basic `INSERT` statement for a 'Books' table. ```bash bash > sqlite3 /tmp/marmot-1.db sqlite3 > INSERT INTO Books (title, author, publication_year) VALUES ('Pride and Prejudice', 'Jane Austen', 1813); ``` -------------------------------- ### Select Data from SQLite Database Source: https://maxpert.github.io/marmot/intro This snippet shows how to query data from an SQLite database using the `sqlite3` command-line interface. It performs a simple `SELECT *` operation on the 'Books' table. ```bash bash > sqlite3 /tmp/marmot-2.db sqlite3 > SELECT * FROM Books; ``` -------------------------------- ### Extract Marmot Archive Source: https://maxpert.github.io/marmot/intro This command extracts the Marmot archive file. It assumes the archive is in the tar.gz format and uses the `tar` utility for extraction. ```bash tar vxzf marmot-v*.tar.gz ``` -------------------------------- ### Marmot Published Row Interface Definition Source: https://maxpert.github.io/marmot/internals Defines the structure of a row change log published by Marmot. It includes information about the originating node, the payload of the change (type, table, and row data), and is serialized using CBOR. ```typescript interface MarmotPublishedRow { FromNodeId: number; Payload: { Id: number; Type: "insert" | "update" | "delete"; TableName: string; Row: {[ColumnName: string]: any} }; } ```