From 0e7ee50a8f2d0cabf78b42d65fcb3b623bc92359 Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Fri, 13 Sep 2024 22:03:31 +0200 Subject: [PATCH] regen --- test/fixtures/generated/1/hyperdb/db.json | 3 ++- test/fixtures/generated/1/hyperdb/index.js | 10 ++++++---- test/fixtures/generated/2/hyperdb/index.js | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/fixtures/generated/1/hyperdb/db.json b/test/fixtures/generated/1/hyperdb/db.json index 5a1f27f..331f659 100644 --- a/test/fixtures/generated/1/hyperdb/db.json +++ b/test/fixtures/generated/1/hyperdb/db.json @@ -6,9 +6,9 @@ "name": "members", "namespace": "db", "id": 0, + "stats": false, "type": 1, "indexes": [ - "@db/members-by-age", "@db/members-by-age" ], "schema": "@db/member", @@ -20,6 +20,7 @@ "name": "members-by-age", "namespace": "db", "id": 1, + "stats": false, "type": 2, "collection": "@db/members", "unique": false, diff --git a/test/fixtures/generated/1/hyperdb/index.js b/test/fixtures/generated/1/hyperdb/index.js index 1d4f65a..e54c97e 100644 --- a/test/fixtures/generated/1/hyperdb/index.js +++ b/test/fixtures/generated/1/hyperdb/index.js @@ -34,6 +34,8 @@ function collection0_reconstruct (version, keyBuf, valueBuf) { // '@db/members' const collection0 = { name: '@db/members', + id: 0, + stats: false, encodeKey: function encodeKey (record) { const key = [record.id] return collection0_key.encode(key) @@ -75,8 +77,9 @@ function index0_indexify (record) { // '@db/members-by-age' const index0 = { - _collectionName: '@db/members', name: '@db/members-by-age', + id: 1, + stats: false, encodeKeys: function encodeKeys (record) { const key = [record.age, record.id] return [index0_key.encode(key)] @@ -92,7 +95,7 @@ const index0 = { encodeValue: (doc) => index0.collection.encodeKey(doc), reconstruct: (keyBuf, valueBuf) => valueBuf, offset: 0, - collection: null + collection: collection0 } const IndexMap = new Map([ @@ -104,9 +107,8 @@ const CollectionMap = new Map([ const Collections = [...CollectionMap.values()] const Indexes = [...IndexMap.values()] for (const index of IndexMap.values()) { - const collection = CollectionMap.get(index._collectionName) + const collection = index.collection collection.indexes.push(index) - index.collection = collection index.offset = collection.indexes.length - 1 } diff --git a/test/fixtures/generated/2/hyperdb/index.js b/test/fixtures/generated/2/hyperdb/index.js index 1496df0..09c43a7 100644 --- a/test/fixtures/generated/2/hyperdb/index.js +++ b/test/fixtures/generated/2/hyperdb/index.js @@ -160,7 +160,6 @@ const Indexes = [...IndexMap.values()] for (const index of IndexMap.values()) { const collection = index.collection collection.indexes.push(index) - index.collection = collection index.offset = collection.indexes.length - 1 }