PACIFICDB v1.2.0 DOCUMENTATION · V1.2 RELEASE
Build with PacificDB.
Install a self-hosted database, work in its interactive shell, connect Node.js, Python, and Java applications, and use the same documentation for documents, vectors, media, backups, security, and operations.
START HERE
Install PacificDB
The native packages include the database engine and native CLI. Choose the package matching your operating system and processor.
Linux: Ubuntu 24.04 x64
Download the Ubuntu 24.04 x86-64 .deb from the v1.2.0, then install it with APT.
sudo apt install ./pacificdb-community-1.2.0-linux-amd64.deb
pacificdb --version
pacificdbWindows
Install Windows Workbench 1.2.0 for the desktop app with its bundled engine and CLI. For a terminal-only installation, use the standalone Windows engine/CLI installer. Open a fresh CMD after installation and run pacificdb --version.
macOS
Download Apple Silicon or Intel. Mount the DMG and copy Workbench to Applications. Both targets were install-tested on macOS 15. Signing/notarization and browser-quarantine policies are not fully qualified.
npm CLI and Node.js client
Node.js 18 or newer is required. Install the matching 1.2.0 client and CLI packages. Pin versions for reproducible deployments.
npm install --global @pacificdb/[email protected] @pacificdb/[email protected]
npm install @pacificdb/[email protected]The npm CLI is a client; installing it does not install the engine.
Published Docker image
The public Linux x64 image is ghcr.io/hitesh-reddy-k/pacificdb-community:1.2.0; see container setup. It retains durable WAL settings. The optional source-build route uses this release checkout:
docker compose up -d --build database
docker compose run --rm shellData remains in the pacificdb-data volume.
Build v1.2.0 from source
Check out immutable tag v1.2.0 (displayed version v1.2.0). Requirements: CMake 3.20+, C++17 compiler, OpenSSL development headers, LZ4, RE2, and Node.js 22.12+ for Workbench development. On Debian/Ubuntu, install libssl-dev, liblz4-dev and libre2-dev before configuring.
git checkout v1.2.0
cmake -S engine -B build -DCMAKE_BUILD_TYPE=Release -DPACIFICDB_ENGINE_VERSION=1.2.0
cmake --build build -j2
./build/pacificdbFIRST DOCUMENT
Quickstart
Install 1.2.0 and run pacificdb. On a loopback connection, the native CLI starts the local engine automatically when it is not already running, then opens the shell.
create database hello
create collection ideas
insert ideas {"id":"first","title":"Hello PacificDB"}
find ideas {"id":"first"}Creating a database selects it automatically in the 1.2.0 CLI.
CONNECT DIRECTLY
Database URLs and authentication
pacificdb://127.0.0.1:9000/app addresses the database protocol. It is not a website and does not open in a browser. Workbench browser mode prints a separate http://127.0.0.1:PORT/ address. Use pacificdbs:// for TLS with certificate and hostname verification.
A URL selects its database; it does not create it. Creation selects the new database after success. No project selection is required. Omit create calls for existing databases and collections; they are not idempotent.
pacificdb --url 'pacificdb://127.0.0.1:9000/app' --no-startFor an authenticated server, set PACIFICDB_URL privately to your complete URL with an encoded username and password, then use the environment variable in each example. Both credentials are required. Do not paste private URLs in source, shared commands, or logs. The native CLI and npm Workbench read this variable. Local desktop mode uses its own loopback engine without an external account.
The 1.2.0 SDKs accept userId, timeoutMs, poolSize, and caFile URL query options. Pool size is 1–32; default is 16. Python explicit options use user_id, timeout (seconds), pool_size, ca_file. Java/Node use userId, timeoutMs, poolSize, caFile. Unknown/duplicate options and conflicting URL/CLI flags fail before connecting.
COMPATIBILITY
Legacy project APIs
Projects remain optional stored metadata. Existing mappings and data are preserved. The new CLI and Workbench use databases directly; their friendly project commands and screens are removed. Legacy SDK createProject/useProject and raw community_project_* APIs remain available for existing consumers.
STRUCTURE
Databases and collections
Create a database to select it automatically, then create a collection. Use an existing database with use <name> or a database-specific connection URL.
| Command | Behavior |
|---|---|
create database <name> | Create a database and select it after success. |
list databases | List accessible ordinary databases. |
use <name> | Validate and select an existing database. |
show database | List collections in the selected database. |
drop database <name> | Drop a user database. |
create collection <name> | Create a collection in the selected database. |
list collections | List collections. |
READ AND WRITE
Documents and queries
Document commands accept JSON objects directly in the shell.
create collection users
insert users {"id":"1","name":"Ada","active":true}
find users {"active":true}
findOne users {"id":"1"}
update users {"id":"1"} {"name":"Ada Lovelace"}
count users {"active":true}
delete users {"id":"1"}Bounded aggregation
The Community aggregation pipeline supports $match, inclusion $project, sort, $skip, $limit, and terminal $count.
aggregate users [{"$match":{"active":true}},{"$project":{"name":1}},{"$sort":{"name":1}},{"$limit":10}]
explain users {"id":"1"}REFERENCE
Shell command reference
The native and npm shells use the same friendly command names and engine actions. Run quit or exit to close the shell; its background engine keeps running. Run help for the installed version’s command list.
npm shell
Connect the installed 1.2.0 shell to an existing engine:
pacificdb --url 'pacificdb://127.0.0.1:9000/app' --no-startDatabases and queries
create database <name>
list databases
use <name>
show database
drop database <name>
create collection <name>
list collections
insert <collection> <json>
find <collection> [filter-json]
findOne <collection> [filter-json]
update <collection> <filter> <json>
delete <collection> <filter-json>
aggregate <collection> <pipeline>
count <collection> [filter-json]
explain <collection> [filter-json]Backups
create backup [--name <name>]
list backups
show backup <id>
restore backup <id>
list restores
delete backup <id>
backup verify <id>
backup export <id> [file]Security and API keys
create api-key [--name <n>] [--role read|readwrite|admin]
list api-keys
show api-key <id>
revoke api-key <id>Media
upload image|video|media <path> [--collection <name>] [--resume <id>]
download media <id> <path>
list media [--all]
find media <query>
show media <id>
delete media <id>
media cleanup <id>Vectors
put vector <collection> <id> <json-vector>
query vector <collection> <json-vector> [--k <n>] [--metric <name>]System
help [topic]
context show
context clear
status
history
clear
request <json>
exit | quitNODE.JS SDK
Node.js
The Apache-2.0 client requires Node.js 18+. Install the exact release:
npm install @pacificdb/[email protected]Start the 1.2.0 engine once with pacificdb. Save the following as hello.mjs and run node hello.mjs.
Use a fresh example database or omit creation for existing data. The file examples require a nonempty demo.mp4 in the current directory and an existing destination directory. Vector collections in these examples use two finite numeric dimensions. Authentication follows the private connection URL guide.
import { PacificDB } from '@pacificdb/client';
const url = process.env.PACIFICDB_URL ?? 'pacificdb://127.0.0.1:9000/node_demo';
const db = await PacificDB.connect(url);
try {
await db.createDatabase(); // Create the URL database; omit if it exists.
await db.createCollection('users');
await db.insert('users', { id: '1', name: 'Ada' });
console.log(await db.find('users', { id: '1' }, { limit: 1 }));
await db.updateOne('users', { id: '1' }, { $set: { name: 'Grace' } });
console.log(await db.request({ action: 'count', collection: 'users', filter: {} }));
await db.deleteOne('users', { id: '1' });
await db.createCollection('embeddings');
await db.putVector('embeddings', 'v1', [0.2, 0.8], { kind: 'vector' });
console.log(await db.queryVector('embeddings', [0.2, 0.8], { k: 5, metric: 'cosine' }));
await db.createCollection('assets');
const media = await db.uploadMediaFile('assets', './demo.mp4');
await db.downloadMediaFile(media.id, './downloaded-node.mp4');
} finally {
db.close();
}For direct authentication use await db.authenticate(username, password); a private URL authenticates on connect. insertMany sends a batch. Use request({ action: 'aggregate', collection, pipeline }) or request({ action: 'explain', collection, filter }) for aggregation and explain. The Node.js SDK exposes these through raw protocol requests. Always call close() in a finally block.
PYTHON SDK
Python
Requires Python 3.10+ and has no runtime dependencies. The verified 1.2.0 package is available on PyPI. Install the matching release in a virtual environment:
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --no-deps pacificdb==1.2.0The GitHub wheel remains an alternative. Start the 1.2.0 engine, save as hello.py, then run python hello.py.
Use a fresh example database or omit creation for existing data. The file examples require a nonempty demo.mp4 in the current directory and an existing destination directory. Vector collections in these examples use two finite numeric dimensions. Authentication follows the private connection URL guide.
import os
from pathlib import Path
from pacificdb import PacificDB
url = os.environ.get('PACIFICDB_URL', 'pacificdb://127.0.0.1:9000/python_demo')
with PacificDB.connect(url) as db:
db.create_database() # Omit for an existing database.
db.create_collection('users')
db.insert('users', {'id': '1', 'name': 'Ada'})
print(db.find_one('users', {'id': '1'}))
db.update_one('users', {'id': '1'}, {'$set': {'name': 'Grace'}})
print(db.count('users'))
db.delete_one('users', {'id': '1'})
db.create_collection('embeddings')
db.vectors.insert(collection='embeddings', data={'id': 'v1', 'kind': 'vector', 'vector': [0.2, 0.8]})
print(db.vectors.query(collection='embeddings', vector=[0.2, 0.8], k=5, metric='cosine'))
db.create_collection('assets')
media = db.media.upload_file('assets', Path('demo.mp4'))
db.media.download_file(media['id'], Path('downloaded-python.mp4'), collection='assets')
# The context manager closes pooled connections, including on failure.Direct authentication is db.authenticate(username, password). An API key can be installed with db.security.use_token(key). Advanced named families include indexes, vectors, media, backups, security, and admin. Their fields follow the engine protocol. PacificDBError.code identifies typed errors. Use with or explicitly call close().
JAVA SDK
Java
Requires Java 11+ and Maven; Jackson is the runtime dependency. Coordinates are in.pacificdb:pacificdb-client:1.2.0. Use the release JAR and matching POM; Maven Central publication is deferred. The SDK uses Jackson 2.22.4. Download its JAR and POM from the release and install them into your local Maven repository:
mvn org.apache.maven.plugins:maven-install-plugin:3.1.2:install-file \
-Dfile=pacificdb-client-1.2.0.jar \
-DpomFile=pacificdb-client-1.2.0.pomAdd this dependency to an application with Maven compiler release 11 or newer. It resolves the locally installed 1.2.0 package.
<dependency>
<groupId>in.pacificdb</groupId>
<artifactId>pacificdb-client</artifactId>
<version>1.2.0</version>
</dependency>Start the 1.2.0 engine and place Hello.java below in src/main/java of that application.
Use a fresh example database or omit creation for existing data. The file examples require a nonempty demo.mp4 in the current directory and an existing destination directory. Vector collections in these examples use two finite numeric dimensions. Authentication follows the private connection URL guide.
import io.pacificdb.PacificDB;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
public class Hello {
public static void main(String[] args) {
String url = System.getenv().getOrDefault("PACIFICDB_URL", "pacificdb://127.0.0.1:9000/java_demo");
try (var db = PacificDB.connect(url)) {
db.createDatabase(); // Omit for an existing database.
db.createCollection("users");
db.insert("users", Map.of("id", "1", "name", "Ada"));
System.out.println(db.findOne("users", Map.of("id", "1")));
db.updateOne("users", Map.of("id", "1"), Map.of("$set", Map.of("name", "Grace")));
System.out.println(db.count("users"));
db.deleteOne("users", Map.of("id", "1"));
db.createCollection("embeddings");
db.vectors().insert(Map.of("collection", "embeddings", "data",
Map.of("id", "v1", "kind", "vector", "vector", List.of(0.2, 0.8))));
System.out.println(db.vectors().query(Map.of("collection", "embeddings",
"vector", List.of(0.2, 0.8), "k", 5, "metric", "cosine")));
db.createCollection("assets");
var media = db.media().uploadFile("assets", Path.of("demo.mp4"));
db.media().downloadFile((String)media.get("id"), Path.of("downloaded-java.mp4"), "assets");
} // AutoCloseable closes the pool, including on failure.
}
}mvn package dependency:build-classpath -Dmdep.outputFile=classpath.txt
java -cp "target/classes:$(cat classpath.txt)" HelloOn Windows use a semicolon between classpath entries. Direct authentication is db.authenticate(username, password); API keys use db.security().useToken(key). Advanced operations take a Map of exact engine fields. PacificDBException.getCode() exposes typed errors. Use try-with-resources or explicitly call close().
DATA OPERATIONS
Backups and restore
Replace backup_... with the created backup ID. Run restore examples only on isolated test data; restore changes server data.
Community backups are operator-triggered full snapshots. Restore runs synchronously and records completed and failed attempts.
create backup --name before-upgrade
list backups
show backup backup_...
backup verify backup_...
backup export backup_... ./before-upgrade.json
restore backup backup_...
list restores
delete backup backup_...DATA OPERATIONS
API keys
Keys can use the read, readwrite, or admin role. Creation and revocation require an administrator.
create api-key --name application --role readwrite
list api-keys
show api-key key_...
revoke api-key key_...DATA OPERATIONS
Media files
Images, GIFs, audio, video, and arbitrary files transfer sequentially in bounded Base64-safe chunks. Every chunk and completed file is verified with SHA-256.
create collection videos
upload video ./demo.mp4 --collection videos
list media
show media media_...
download media media_... ./downloaded.mp4Replace media_... with the upload’s returned ID. For an interrupted upload, resume the same unchanged file and collection with upload video ./demo.mp4 --collection videos --resume media_.... Use media cleanup media_... only to discard an incomplete upload. PacificDB applies no application-level total file-size cap. Available disk space, request limits, network time, and machine resources still limit transfers.
DATA OPERATIONS
Vector search
v1.2 adds dense, sparse and named vectors with creation-time schemas; packed flat exact and HNSW indexes; cosine, L2 and dot metrics; and BM25/RRF keyword-vector hybrid retrieval. Filters use the existing metadata query syntax. Native vector/index/hybrid operations are an opt-in standalone configuration: set PACIFICDB_VECTOR_PREVIEW_ENABLED=1 before engine startup, or use the separate desktop opt-in above.
Explicit ANN requires an eligible ready index. Selective/unsupported ANN filters need an explicitly permitted exact fallback or return an error. Strict ANN can be unavailable during writes. Graphs require rebuilding after restart; large builds can take many minutes. Distributed vector completeness and automatic graph compaction remain incomplete. See the current vector usage guide for schema, sparse/named, index lifecycle and hybrid options.
Dense vectors must be non-empty arrays of finite numbers; sparse vectors use the validated sparse-v1 format. Query k must be a positive integer. Supported metrics include cosine, L2/euclidean, dot, and dot product.
create collection embeddings
put vector embeddings item-1 [0.2,0.8]
put vector embeddings item-2 [0.8,0.2]
query vector embeddings [0.2,0.8] --k 5 --metric cosineNode.js vector API
await db.putVector('embeddings', 'hero-vector', [0.2, 0.8], {
modality: 'image', assetId: 'hero'
});
const matches = await db.queryVector('embeddings', [0.2, 0.8], {
k: 5, filter: { assetId: 'hero' }
});DESKTOP
Workbench
v1.2 includes the GUI, native engine and CLI. Download Ubuntu 24.04 x64, Windows x64, macOS Apple Silicon or macOS Intel. Verify the checksums before installation.
Use a graphical session and a new evaluation data directory. Desktop owns its local engine and retains data between launches. File → Copy CLI connection command gives the actual bundled CLI path and port. The npm CLI also offers browser mode with pacificdb workbench; the native CLI does not provide that subcommand.
v1.2 fixes short-window navigation and retains upstream Linux sandbox integration. Do not run the GUI as root or disable its sandbox. Windows/macOS installers are unsigned; macOS is not notarized. Managed devices may require IT approval.
For native vectors, quit the app and set PACIFICDB_WORKBENCH_VECTOR_PREVIEW=1 before launching. SDK-only schema/index/hybrid operations are documented in the vector guide.
OPERATE
Configuration and local files
Connect to another engine
pacificdb --host db.example.internal --port 9000 --no-start
pacificdb --host db.example.internal --port 9000 ping --no-startEngine home
| Platform | Default location |
|---|---|
| Linux | ${XDG_DATA_HOME:-$HOME/.local/share}/pacificdb |
| macOS | ~/Library/Application Support/PacificDB |
| Windows | %LOCALAPPDATA%\PacificDB |
OPERATE
Security checklist
- Keep development mode bound to
127.0.0.1. - Enable authentication and TLS before accepting network connections.
- Give applications the smallest API-key role they need.
- Store passwords and API keys outside source code and logs.
- Restrict filesystem access to PacificDB data and backup roots.
- Verify backups and perform restoration drills on isolated data roots.
TERMINAL
pacificdb --version
On Windows, the Workbench installer registers its bundled CLI. Close existing terminal windows and open a new CMD. On macOS/Linux, choose File → Install pacificdb terminal command in Workbench, then open a new terminal. Run pacificdb --version; expect PacificDB 1.2.0. The version command works offline. Use File → Copy CLI connection command to connect to the open Workbench database; the native CLI otherwise has its own default data directory.
OPERATE
Troubleshooting
SDK import/method errors usually mean an older package is installed: reinstall version 1.2.0 in your environment or local Maven repository. For connection refused, start the engine and verify its current host/port. For TLS failures check the server hostname and trust chain; supply a valid custom CA rather than disabling verification. After a failed write, inspect server state before retrying. For media errors keep the upload ID and same file for explicit resume; check disk space and destination permissions.
A pacificdb:// URL cannot be opened as a browser page. Use Workbench’s printed HTTP URL. For the Linux sandbox error follow the helper setup; a Debian install runs the configured after-install hook.
port 9000 is in use by a service that is not PacificDB
Stop that program or start PacificDB on another port, for example pacificdb --port 9001.
Connecting to a selected database
Use pacificdb --url pacificdb://127.0.0.1:9000/app, or create a database in the shell. Set credentials privately through PACIFICDB_URL. Use pacificdbs:// for verified TLS.
The npm CLI cannot start the engine
The npm package contains the client shell only. Install a native PacificDB package, start the engine separately, or connect with --no-start.
select a database with: use <name>
Create or select a database before collection, document, media, or vector commands.
Older context contains a project
The updated shell preserves the database selection and removes project IDs and credentials when saving context. Legacy project metadata is not deleted.
EXISTING INSTALLATIONS
Upgrade to v1.2.0
Keep the existing binaries and verify a full backup before upgrading. Stop applications and the matching engine before replacing binaries; test against a copy of your data in an isolated data directory. Install the matching 1.2.0 engine and SDK packages, then confirm pacificdb --version.
Upgrades from older security releases may require explicit superadmin assignment for legacy authenticated databases without owners, a review of grants, and RE2-compatible regex filters. Backreferences/lookarounds are rejected. See the security upgrade notes.
The database-first workflow preserves project metadata: project mappings remain stored and legacy SDK/raw APIs remain available. A created database becomes selected automatically; use a database URL or use name for existing data. Friendly project CLI commands and Workbench project screens are removed. Older CLI context retains its database and clears project IDs/tokens.
Use matching 1.2.0 SDKs for URL/CRUD/file convenience methods, close pooled connections, and catch typed errors. Interrupted writes can have an unknown outcome and are never automatically retried. Resume media explicitly using the returned upload ID and unchanged source file. Verify downloads before restoring/replacing any destination file.
OPERATE
v1.2 status and support
v1.2 Release uses package version1.2.0. Verify checksums for native and Workbench downloads and record build-info when reporting installation or compatibility issues. Windows/macOS packages are unsigned and macOS is not notarized.
