Record<string, V>
, but does not assume that a value exists for each key.
Type of values
Types that Jine can use to index database items
A database migration.
A migration is a function that is given a Transaction and is allowed to do as it pleases with it. Migrations have special access to Transaction.addStore, Transaction.removeStore, Store.addIndex, and Store.removeIndex to allow you to change the shape of your database. Additionally, migrations are not allowed to access store indexes.
See Example for example use of a Migration.
The database shape during migrations.
The essential meaning of this is that items access during migrations will not be encoded or decoded, and indexes are not available during migrations.
Types that are natively indexable by Jine.
The types are ordered as follows:
undefined < null < false < true < number < date < string < binary < array
Also note the following:
A number
may not be NaN
A Date
object's internal [[DateValue]]
slot may not be NaN
Jine doesn't support all numbers
; a small handful of very large
negative numbers will be snapped to slightly higher (less negative) values.
Types that are natively storable by Jine
Note that the lastIndex
property of a RegExp
is not preserved.
Query specification
A query falls into one of 3 categories:
Wildcard: A wildcard query selects everything. This is given by 'all'
.
Exact: An exact query selects a particular value. This is given by { equals: value }
.
Range: A range query selects values within a particular range. The range may be
bounded below or above, or both, but not neither. Both bounds may be inclusive
or exclusive. Lower bounds are given by the keys from
and above
, for inclusive
and exclusive, respectively; likewise, upper bounds are given by keywords
through
and below
. Thus { from: 0, below: 10 }
represents 0 <= x < 10
and
{ through: 3 }
represents
x <= 3
.
Additionally, a query may have the reversed
and unique
keys. reversed
marks that
the query results should be traversed in reverse order, and unique
marks that
duplicated values should be skipped.
Types that Jine can store in the database
Modes that a transaction can take.
r
- Read only. Multiple read-only transactions can occur on the same stores at the same time.
rw
- Read and write. A read-write transaction will block accessed stores until it is complete.
m
- Migration. A migration transaction will block an entire database from use until it is complete.
Typescript users must declare this attribute on any custom-encodable classes. The value should be the type that the class encodes to.
Constructs a codec for a custom type. Supplied to Database.constructor. See Custom Types.
Generated using TypeDoc
A value that can be
await
-ed to produce aT