Tableland Documentation

website·Indexed 33 days ago

https://docs.tableland.xyz/

Documentation for Tableland, a web3 database platform. Includes guides on using the JavaScript/TypeScript SDK, the Validator Gateway API, and a unique subset of SQLite for database operations. Covers smart contract integration with Tableland controllers for access control, row-level permissions, and tutorials for building dynamic NFTs and key-value stores.

Tokens
135.8K
Snippets
682
Records
1K
Agent score
64%

What's inside Tableland

  1. Overview of the Tableland CLI

    The Tableland CLI is a command-line wrapper around the Tableland SDK. It extends the SDK's functionality by allowing users to interact with tables across the network and perform bulk operations, such as writing to the database directly from SQL files or CSV data.
  2. Overview of Tableland web3 SQL database

    Tableland is a web3 SQL database compatible with EVM chains, including Ethereum, Optimism, Arbitrum One, Arbitrum Nova, Base, Polygon, and Filecoin. It allows developers to scale, mutate, and access chain-driven data (such as onchain rules and identity) by offloading accessibility to a decentralized network of validator nodes that monitor the host chain for updates.
  3. Overview of Tableland and Lit Protocol integration

    Tableland data is open by default. To implement private data storage, Lit Protocol can be used as a decentralized key management network. Instead of a single entity holding a private key, Lit distributes key shares across a network. Decryption requires a pre-defined threshold of nodes to combine shares. This allows developers to encrypt data before writing it to Tableland and decrypt it upon reading, using Lit's built-in access control system.
  4. Overview of the Signer interface

    The Signer interface represents an account on the Ethereum Blockchain. While typically backed by a private key (via mnemonic or hardware wallet), the API is abstract to support advanced signing entities like Smart Contract Wallets or Virtual Wallets. It extends Addressable, ContractRunner, and NameResolver.
  5. Overview of the Tableland SDK

    The @tableland/sdk provides a client that implements the Cloudflare D1 Database interface on top of the Tableland network, allowing it to be used as a drop-in replacement for community-created D1 tools and libraries. It supports both ESM and CommonJS. The SDK consists of three main APIs:

    1. Database API: The primary API for SQL operations, compatible with the Cloudflare D1 client API.
    2. Validator API: A secondary API for interacting directly with Tableland Validator nodes.
    3. Registry API: A secondary API for calling Tableland's smart contracts (e.g., onchain access control).
  6. Overview of Tableland Studio

    Tableland Studio is a web application designed to help users create projects to organize tables and collaborate with others. It abstracts blockchain-specific complexities, making it an ideal entry point for getting started with Tableland.
  7. Overview of Tableland Access Control methods

    Tableland provides two complementary methods for configuring access control on a per-table basis:

    1. Smart Contract Rules & Controllers: A flexible, dynamic system where a controller contract asserts user permissions (e.g., based on token balances, roles, or ownership) before allowing INSERT, UPDATE, or DELETE operations. These can include specific WHERE and WITH CHECK clauses.
    2. SQL GRANT/REVOKE Statements: A simpler, more rigid system familiar to SQL developers. These grant static INSERT, UPDATE, or DELETE permissions to specific addresses and cannot be based on on-chain dynamic definitions.
  8. Overview of Tableland Symmetric Encryption Plugin

    The experimental encryption plugin allows developers to encrypt table data before writing it to Tableland and decrypt it after querying. It uses AES symmetric encryption. Because Tableland is an open database, data is publicly readable unless encrypted.

    Warning: This plugin is a simple symmetric implementation and is NOT suitable for production use cases. It is intended as a reference point for building more secure, custom encryption schemes using the createProcessor method.

  9. Overview of Tableland SQL Specification

    Tableland uses a unique subset of the SQLite SQL language. While it omits many standard SQL features, it adds specific constraints and features tailored for Tableland operations. The core API is summarized by eight primary statement types: CREATE TABLE, ALTER TABLE, INSERT, UPDATE, DELETE, SELECT, GRANT, and REVOKE.
  10. Overview of JETI for Tableland SDK

    The JETI (JavaScript Extension for Tableland Integrations) package is a library used with the @tableland/sdk to transform data on the client-side. It allows developers to transform data before submitting it to Tableland and 'untransform' data retrieved from queries. It provides built-in extensions for IPFS pinning, string truncation, and encryption, as well as a createProcessor function for building custom plugins.
  11. Overview of the Tableland Registry contract

    The Tableland registry smart contract controls the creation and mutation of tables as well as access controls. Interactions with the registry involve passing raw SQL statements which are emitted and later materialized at the Tableland validator node. It is highly recommended to use the TablelandDeployments.sol and SQLHelpers.sol libraries to construct these SQL statements.
  12. Overview of Tableland's relational database architecture

    Tableland is a permissionless relational database network designed to scale structured web3 data. It functions as a collection of SQL databases that communicate and agree on table states based on on-chain instructions. Unlike standard blockchains, which are global state machines for computation, Tableland provides a native relational data layer for efficient storage and retrieval of structured data using SQL.