/**
* @license
* Copyright 2015 The Lovefield Project Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Type definitions for Lovefield
// Project: http://google.github.io/lovefield/
///
declare module lf {
export enum Order { ASC, DESC }
export enum Type {
ARRAY_BUFFER,
BOOLEAN,
DATE_TIME,
INTEGER,
NUMBER,
OBJECT,
STRING
}
export enum ConstraintAction {
RESTRICT,
CASCADE
}
export enum ConstraintTiming {
IMMEDIATE,
DEFERRABLE
}
export interface Binder {
getIndex(): number
}
export interface Predicate {}
export interface Row {}
type ValueLiteral = string|number|boolean|Date;
export interface PredicateProvider {
eq(operand: ValueLiteral|schema.Column|Binder): Predicate
neq(operand: ValueLiteral|schema.Column|Binder): Predicate
lt(operand: ValueLiteral|schema.Column|Binder): Predicate
lte(operand: ValueLiteral|schema.Column|Binder): Predicate
gt(operand: ValueLiteral|schema.Column|Binder): Predicate
gte(operand: ValueLiteral|schema.Column|Binder): Predicate
match(operand: RegExp|Binder): Predicate
between(from: ValueLiteral|Binder, to: ValueLiteral|Binder): Predicate
in(values: Binder|Array): Predicate
isNull(): Predicate
isNotNull(): Predicate
}
function bind(index: number): Binder;
export interface TransactionStats {
success(): boolean
insertedRowCount(): Number
updatedRowCount(): Number
deletedRowCount(): Number
changedTableCount(): Number
}
export interface Transaction {
attach(query: query.Builder): Promise>
begin(scope: Array): Promise
commit(): Promise
exec(queries: Array): Promise>>
rollback(): Promise
stats(): TransactionStats
}
export enum TransactionType { READ_ONLY, READ_WRITE }
export interface Database {
close(): void
createTransaction(type?: TransactionType): Transaction
delete(): query.Delete
export(): Promise