pig/workspace/schema

Schema initialization for pig workspace.

Values

pub fn init(
  conn: sqlight.Connection,
) -> Result(Nil, sqlight.Error)

Initialize the database schema for the pig workspace.

This function creates all necessary tables and indexes for the virtual filesystem and key-value store. It is idempotent, meaning it can be called multiple times without error.

Pragmas

  • Sets WAL mode for better concurrency
  • Sets busy timeout to 5 seconds

Tables Created

  • vfs_inode: File inode metadata
  • vfs_dentry: Directory entries (name -> inode mapping)
  • vfs_data: File data chunks
  • kv_store: Key-value storage

Root Directory

Creates the root directory inode (ino=1, mode=16877) if it doesn’t exist.

Search Document