pgfirestore
pgfirestore · Implements Firestore-style document values, collection queries, and query operators inside PostgreSQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100877 | pgfirestore | pgfirestore | 0.0.0 | SIM | Unknown | Rust |
PostgreSQL · 11, 12, 13, 14, 15
Usage
Sources:
pgfirestore is an experimental PostgreSQL query engine that models part of Firestore’s hierarchical document and value semantics. Documents live in one fs_documents table as custom fsvalue references and maps. Upstream describes it as an exploration with no performance expectations, and the project is abandoned.
Core Workflow
Create typed references and maps, insert them into the document table, then query a collection group with Firestore-style comparison operators:
fs_collection(parent, collection_id) returns one collection below a reference; fs_collection_group(collection_id) finds collections with that ID anywhere below the database root.
Types, Constructors, and Operators
fsvalue: CBOR-backed value type with a JSON textual representation and Firestore cross-type ordering.fs_null(),fs_nan(),fs_boolean(bool),fs_number_from_integer(integer), andfs_number_from_double(double precision).fs_string(text),fs_reference(text),fs_array(fsvalue[]), andfs_map_from_entries(text[], fsvalue[]).#<,#>,#<=,#>=,#=, and#!=: same-type Firestore query comparisons; ordinary PostgreSQL comparison operators implement cross-type ordering.->: extracts a nested document property.
Caveats
fs_documents has only its primary key and no secondary indexes, so collection scans and property filters are not designed for scale. Firestore security rules are not implemented, and the published code leaves Date and GeoPoint values unimplemented despite showing their prospective external representation.
This is not a Firestore server, synchronization layer, or compatibility guarantee. Validate every supported type and operator against the application’s required semantics, enforce authorization separately, and use only disposable experimental databases.