Repository navigation
hidane 0.7.0 serves Datastore mode: started with --database-mode datastore-mode, as gcloud emulators firestore start --database-mode=datastore-mode starts the official emulator, it answers the Cloud Datastore client libraries. On an enterprise database, it now runs pipelines and stores the BSON types. It also reports the indexes your queries need.
Verified against the official Cloud Firestore emulator v1.22.0, as firebase-tools 15.33.0 downloads it. Per-client versions are in docs/sdk-certification.md. The tests replay 54,378 recorded answers of the official emulator, from 78 fixtures.
Changes that may affect your tests
These are compatibility fixes (docs/versioning.md). Each makes hidane answer as the official emulator does, so a test written against hidane's earlier answer can start failing.
- Startup flags (#369).
--database-modetakesfirestore-nativeanddatastore-modeonly, and--database-editiontakesstandardandenterpriseonly, written exactly so.- Any other value stops hidane with exit code 1 and the official message,
Unsupported database mode: X. …. This includes the names--helplists, such asCLOUD_FIRESTOREorENTERPRISE. --require_indexesin Firestore Native mode no longer stops hidane. It starts, and refuses every RunQuery with "Firestore Native mode does not support index enforcement".
- The Datastore API in Firestore Native mode (#371). It is now served, and each request is refused with "Database mode not set to Datastore Mode. …", as on the official emulator. Before, it answered gRPC
UNIMPLEMENTEDor REST404. Server reflection listsgoogle.datastore.v1.Datastore. - Enterprise edition. These apply on a database started with
--database-edition enterprise, or set to it with:setDatabaseEdition.- Writes (#350):
- arrays may hold arrays;
- values and documents have no size limit;
- maps and arrays count alike toward 20 levels;
- a problem inside a map is reported as it is at the top level.
- Listeners (#353) check their query with null and NaN as values, as the official emulator does (D091 is retired).
- Writes (#350):
New
- Datastore mode (#81, ADR 0009).
--database-mode datastore-modeservesgoogle.datastore.v1.Datastoreover gRPC and REST, and refuses the Firestore API as the official emulator does.- Requests: Lookup, RunQuery and RunAggregationQuery, both structured and in GQL (#358, #360); BeginTransaction, Commit, Rollback, AllocateIds and ReserveIds.
- Data model: Datastore's values, their order and its key model, with numeric IDs allocated as the official emulator allocates them.
- Indexes:
--require_indexeswith--index_filerefuses a query that needs a composite index the file does not define (#361). - Export and import:
:export,:importand--import-data, in the official format of that mode (#368). - Protobuf over REST: answered when the Content-Type is
application/x-protobuf, as the Java and Python client libraries send it (#367). - Client libraries: the Datastore libraries for Node.js, Python, Java and Go are verified against it (#367).
- Testing: a differential fuzzer and a second round of recordings fixed what still differed (#370–#381).
- Pipelines on an enterprise database (#80, #347):
ExecutePipelineover gRPC and REST. - The BSON types on an enterprise database (#352):
- MinKey and MaxKey, ObjectId, regular expressions, Int32, Decimal128, BSON timestamps and binary data;
- written, checked, ordered and compared as the official emulator does.
POST …/databases/{d}:setDatabaseEdition(#354): sets one database's edition, standard or enterprise.GET /emulator/v1/projects/{p}:indexUsage(#346): the composite indexes the queries run so far would need in production, counted as the official emulator counts them.- Verified clients:
@google-cloud/firestore9.4.0 (#423).hidane doctorkeeps counting the release verified before the current one as verified (#427). - Benchmark scenarios (#355):
firebase_startup: the time until the port accepts, throughfirebase emulators:start;large_dataset: memory after 500,000 documents.
- Parity records: the production column of docs/parity-exceptions.md records where production Firestore differs from the official emulator (#82), as a nightly replay of the recordings against production finds it. hidane follows the official emulator there.
Breaking changes
None to a stable surface. The changes above are compatibility fixes.
Install
curl -fsSL https://hidane.dev/install.sh | sh
brew install hidane-dev/tap/hidane
npm install --save-dev hidane
cargo binstall hidane # or cargo install hidane
dart pub global activate hidane
docker run --rm -p 8080:8080 ghcr.io/hidane-dev/hidane:0.7.0Full changelog: v0.6.0...v0.7.0