pglite-oxide 0.3.0

Rust helpers for embedding the Electric SQL pglite WebAssembly PostgreSQL runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::env;
use std::path::PathBuf;

use anyhow::Result;
use pglite_oxide::build_pgdata_template;

fn main() -> Result<()> {
    let output_dir = env::args_os()
        .nth(1)
        .map(PathBuf::from)
        .unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("assets/prepopulated"));

    let template = build_pgdata_template(&output_dir)?;
    println!("archive: {}", template.archive_path.display());
    println!("manifest: {}", template.manifest_path.display());
    Ok(())
}