-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support nested keys * bump deps and fix suffix * fix bug and regen * no runtime resolves * final fixes * standard
- Loading branch information
Showing
21 changed files
with
820 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const HyperDB = require('../../../builder') | ||
const Hyperschema = require('hyperschema') | ||
const path = require('path') | ||
|
||
const SCHEMA_DIR = path.join(__dirname, '../generated/4/hyperschema') | ||
const DB_DIR = path.join(__dirname, '../generated/4/hyperdb') | ||
|
||
const schema = Hyperschema.from(SCHEMA_DIR) | ||
|
||
const dbSchema = schema.namespace('db') | ||
|
||
dbSchema.register({ | ||
name: 'member', | ||
fields: [ | ||
{ | ||
name: 'id', | ||
type: 'string', | ||
required: true | ||
}, | ||
{ | ||
name: 'age', | ||
type: 'uint', | ||
required: true | ||
} | ||
] | ||
}) | ||
|
||
dbSchema.register({ | ||
name: 'nested', | ||
fields: [ | ||
{ | ||
name: 'member', | ||
type: '@db/member', | ||
required: true | ||
}, | ||
{ | ||
name: 'fun', | ||
type: 'bool' | ||
} | ||
] | ||
}) | ||
|
||
Hyperschema.toDisk(schema) | ||
|
||
const db = HyperDB.from(SCHEMA_DIR, DB_DIR) | ||
const testDb = db.namespace('db') | ||
|
||
testDb.collections.register({ | ||
name: 'nested-members', | ||
schema: '@db/nested', | ||
key: ['member.id'] | ||
}) | ||
|
||
HyperDB.toDisk(db) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require('./builders/1.js') | ||
require('./builders/2.js') | ||
require('./builders/3.js') | ||
require('./builders/4.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.