Merge pull request #5758 from freshp86/master

Updating lovefield definitions for Lovefield v2.0.62.
This commit is contained in:
Horiuchi_H
2015-09-10 15:33:01 +09:00
2 changed files with 23 additions and 2 deletions
+2
View File
@@ -43,6 +43,8 @@ function main(): void {
}).then(
function() {
return todoDb.select(lf.fn.count()).from(itemSchema).exec();
}).then(function() {
return todoDb.export();
});
}
+21 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Lovefield v2.0.56
// Type definitions for Lovefield v2.0.62
// Project: http://google.github.io/lovefield/
// Definitions by: freshp86 <https://github.com/freshp86>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -18,6 +18,16 @@ declare module lf {
STRING
}
export enum ConstraintAction {
RESTRICT,
CASCADE
}
export enum ConstraintTiming {
IMMEDIATE,
DEFERRABLE
}
export interface Binder {
getIndex(): number
}
@@ -56,7 +66,9 @@ declare module lf {
close(): void
createTransaction(type?: TransactionType): Transaction
delete(): query.Delete
export(): Promise<Object>
getSchema(): schema.Database
import(data: Object): Promise<void>
insertOrReplace(): query.Insert
insert(): query.Insert
observe(query: query.Select, callback: Function): void
@@ -174,9 +186,16 @@ declare module lf {
order: Order
}
type RawForeignKeySpec = {
local: string
ref: string
action: lf.ConstraintAction
timing: lf.ConstraintAction
}
export interface TableBuilder {
addColumn(name: string, type: lf.Type): TableBuilder
addForeignKey(): TableBuilder
addForeignKey(name: string, spec: RawForeignKeySpec): TableBuilder
addIndex(
name: string, columns: Array<string>|Array<IndexedColumn>,
unique?: boolean, order?: Order): TableBuilder