Lovefield Typescript port and modernization.
The port attempts to maintain API compatibility as much as possible.
Documentation of how to use this library can be found here.
lib/base/lovefield_options.ts
. Users are supposed to define an object
following that interface and set options via the new API lf.options.set()
.
testing/debug_options.ts
.All namespaces are flattened. For example:
lf.Order
is flattened to Order
lf.schema.DataStoreType
is flattened to DataStoreType
Please note, in ES6 modules, we usually do
import * as lf from './node_modules/lovefield-ts/dist/es6/lf.js';
const order = lf.Order.DESC; // still prefixed by lf, ES6 module syntax
In CommonJS module system used by Node.js, we usually do
const lf = require('lovefield-ts');
const order = lf.Order.DESC; // still prefixed by lf, CommonJS syntax.
TypeScript users cannot refer column by name, use .col()
API.
const item = db.getSchema().table('Item');
// Use .col() API to refer to column here.
// TypeScript indexed property forces everything to be typed the same.
// This is a language limit and not much Lovefield authors can do here.
//
// item['orderDate'] <== this will cause type errors
// item.col('orderDate') <== this will give perfect type checking
return db.select().from(item).orderBy(item.col('orderDate')).exec();
external
directory. Currently they are not part of the automated test
process yet.lib
: Lovefield main library source codetesting
: Facility code used for testingtests
: Tests for Lovefield main librarydocs
: Documentsout
: Temporary directory used to store intermediate files from tool chaindist
: Generated dist filescoverage
: Code coverage report generated by Karmaexternal
: Demos and tests that test Lovefield-ts as an external module