@fxjs/orm
Advanced tools
Comparing version 1.6.0 to 1.6.1
/// <reference types="fibjs" /> | ||
/// <reference path="3rd.d.ts" /> | ||
declare namespace FxOrmNS { | ||
@@ -72,2 +74,4 @@ /* Connection About Patch :start */ | ||
export interface FibORM extends ORM { | ||
connectSync(opts: FibORMIConnectionOptions | string): FibORM; | ||
connect(opts: FibORMIConnectionOptions | string): (err, orm: FibORM) => any; | ||
/* all fixed: start */ | ||
@@ -102,4 +106,2 @@ models: { [key: string]: FibOrmFixedModel }; | ||
export function connectSync(opts: FibORMIConnectionOptions | string): FibOrmDB; | ||
export interface FibORMIConnectionOptions extends IConnectionOptions { | ||
@@ -134,2 +136,3 @@ timezone: string; | ||
delAccessor: string; | ||
addAccessor?: string; | ||
@@ -404,10 +407,2 @@ model: FibOrmFixedModel; | ||
export interface FibOrmPatchedSyncfiedDueToAggregationInstance { | ||
/* function getXxx() */ | ||
} | ||
// export type FibOrmObjectToPatch = | ||
// FibOrmFixedModel | FibOrmFixedModelInstance | ||
// | FibOrmPatchedSyncfiedInstantce | PatchedSyncfiedInstanceWithDbWriteOperation | PatchedSyncfiedInstanceWithAssociations | ||
export interface IChainFibORMFind extends PatchedSyncfiedModelOrInstance, FxOrmNSSqlQueryNS.SelectQuery { | ||
@@ -474,6 +469,2 @@ only(args: string | string[]): IChainFibORMFind; | ||
} | ||
// interface ReqWhere { | ||
// [key: string]: QueryConditionAtomicType | ||
// or?: QueryConditionAtomicType[] | ||
// } | ||
/* query conditions :end */ | ||
@@ -662,15 +653,15 @@ | ||
export interface ChainFindInstanceType { | ||
all(conditions: ModelMethod__FindConditions): IChainFind; | ||
where(conditions: ModelMethod__FindConditions): IChainFind; | ||
find(conditions: ModelMethod__FindConditions): IChainFind; | ||
export interface IChainFindInstance { | ||
all(conditions: ModelMethod__FindConditions): IChainFindInstance; | ||
where(conditions: ModelMethod__FindConditions): IChainFindInstance; | ||
find(conditions: ModelMethod__FindConditions): IChainFindInstance; | ||
only(...args: string[]): IChainFindInstance; | ||
omit(): IChainFindInstance; | ||
skip(offset: number): IChainFindInstance; | ||
offset(offset: number): IChainFindInstance; | ||
only(...args: string[]): IChainFind; | ||
omit(): IChainFind; | ||
skip(offset: number): IChainFind; | ||
offset(offset: number): IChainFind; | ||
order(propertyOrderDesc: string, order: string | "Z" | "A"): IChainFind; | ||
orderRaw(str: string, args: any[]): IChainFind; | ||
limit(limit: number): IChainFind; | ||
order(propertyOrderDesc: string, order?: string | "Z" | "A"): IChainFindInstance; | ||
orderRaw(str: string, args: any[]): IChainFindInstance; | ||
limit(limit: number): IChainFindInstance; | ||
count(callback: ModelMethod__CountCallback): void; | ||
@@ -687,8 +678,10 @@ remove(callback: (err: Error) => void): void; | ||
each(callback: (result: Instance) => void): void; | ||
each(): IChainFind; | ||
each(): IChainFindInstance; | ||
eager(): IChainFind; | ||
eager(): IChainFindInstance; | ||
model: FibOrmFixedModel; | ||
options: ChainFindInstanceOptions | ||
[extraProperty: string]: any; | ||
} | ||
@@ -742,2 +735,25 @@ | ||
drop(callback: (err: Error) => void): ORM; | ||
static equalToProperty(name: string, message?: string); | ||
static unique(message?: string); | ||
static unique(opts: { ignoreCase: boolean }, message?: string); | ||
static Text(type: string): FxOrmNSSqlQueryNS.TextQuery; | ||
static eq(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
static ne(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
static gt(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
static gte(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
static lt(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
static lte(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
static like(value: string): FxOrmNSSqlQueryNS.Comparator; | ||
static not_like(value: string): FxOrmNSSqlQueryNS.Comparator; | ||
static not_in(value: string): FxOrmNSSqlQueryNS.Comparator; | ||
static between(a: number, b: number): FxOrmNSSqlQueryNS.Comparator; | ||
static not_between(a: number, b: number): FxOrmNSSqlQueryNS.Comparator; | ||
static use(connection, protocol: string, options, callback: (err: Error, db?: ORM) => void); | ||
static connect(uri: string): ORM; | ||
static connect(uri: string, callback: (err: Error, db: ORM) => void); | ||
static connect(options: IConnectionOptions): ORM; | ||
static connect(options: IConnectionOptions, callback: (err: Error, db: ORM) => void); | ||
} | ||
@@ -761,7 +777,2 @@ | ||
} | ||
export function equalToProperty(name: string, message?: string); | ||
export function unique(message?: string); | ||
export function unique(opts: { ignoreCase: boolean }, message?: string); | ||
export interface SingletonOptions { | ||
@@ -809,8 +820,2 @@ identityCache?: any; | ||
} | ||
//[key: string]: { | ||
// get: (key, def) => any; | ||
// set: (key, value) => Settings; | ||
// unset: (...keys: string[]) => Settings; | ||
//} | ||
} | ||
@@ -837,23 +842,2 @@ | ||
export function Text(type: string): FxOrmNSSqlQueryNS.TextQuery; | ||
export function eq(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
export function ne(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
export function gt(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
export function gte(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
export function lt(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
export function lte(value: any): FxOrmNSSqlQueryNS.Comparator; | ||
export function like(value: string): FxOrmNSSqlQueryNS.Comparator; | ||
export function not_like(value: string): FxOrmNSSqlQueryNS.Comparator; | ||
export function not_in(value: string): FxOrmNSSqlQueryNS.Comparator; | ||
export function between(a: number, b: number): FxOrmNSSqlQueryNS.Comparator; | ||
export function not_between(a: number, b: number): FxOrmNSSqlQueryNS.Comparator; | ||
export function express(uri: string, handlers: { | ||
define(db: ORM, models: { [key: string]: Model }); | ||
}): (req, res, next) => void; | ||
export function use(connection, protocol: string, options, callback: (err: Error, db?: ORM) => void); | ||
export function connect(uri: string): ORM; | ||
export function connect(uri: string, callback: (err: Error, db: ORM) => void); | ||
export function connect(options: IConnectionOptions): ORM; | ||
export function connect(options: IConnectionOptions, callback: (err: Error, db: ORM) => void); | ||
} | ||
@@ -860,0 +844,0 @@ import FibOrmNS = FxOrmNS |
v1.6.0 / 2018-11-17 | ||
v1.6.1 / 2018-11-17 | ||
================== | ||
* typo fix. | ||
v1.6.0 / 2018-11-17 | ||
=================== | ||
* Release v1.6.0 | ||
* better typo | ||
@@ -6,0 +12,0 @@ |
@@ -1,3 +0,1 @@ | ||
/// <reference path="index.d.ts" /> | ||
/// <reference path="../../@types/index.d.ts" /> | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -4,0 +2,0 @@ const db = require("db"); |
@@ -5,3 +5,3 @@ var _ = require("lodash"); | ||
var ChainInstance = require("./ChainInstance"); | ||
var Promise = require("./Promise").Promise; | ||
var SimplePromise = require("./SimplePromise").SimplePromise; | ||
function addChainMethod(chain, association, opts) { | ||
@@ -241,3 +241,3 @@ chain[association.hasAccessor] = function (value) { | ||
if (!promise) { | ||
promise = new Promise(); | ||
promise = new SimplePromise(); | ||
promise.handle(this.all); | ||
@@ -249,3 +249,3 @@ } | ||
if (!promise) { | ||
promise = new Promise(); | ||
promise = new SimplePromise(); | ||
promise.handle(this.all); | ||
@@ -252,0 +252,0 @@ } |
@@ -1,6 +0,4 @@ | ||
var Utilities = require("../../Utilities"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var mongodb = require("mongodb"); | ||
var util = require("util"); | ||
var _ = require('lodash'); | ||
exports.Driver = Driver; | ||
function Driver(config, connection, opts) { | ||
@@ -19,2 +17,3 @@ this.client = new mongodb.MongoClient(); | ||
} | ||
exports.Driver = Driver; | ||
Driver.prototype.sync = function (opts, cb) { | ||
@@ -21,0 +20,0 @@ this.db.createCollection(opts.table, function (err, collection) { |
@@ -0,1 +1,2 @@ | ||
/// <reference lib="es2015" /> | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -2,0 +3,0 @@ var _ = require("lodash"); |
@@ -0,3 +1,3 @@ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _ = require("lodash"); | ||
var util = require("util"); | ||
var sqlite3 = require("sqlite3"); | ||
@@ -7,3 +7,2 @@ var Query = require("sql-query").Query; | ||
var DDL = require("../DDL/SQL"); | ||
exports.Driver = Driver; | ||
function Driver(config, connection, opts) { | ||
@@ -38,2 +37,3 @@ this.dialect = 'sqlite'; | ||
} | ||
exports.Driver = Driver; | ||
_.extend(Driver.prototype, shared, DDL); | ||
@@ -40,0 +40,0 @@ Driver.prototype.ping = function (cb) { |
@@ -1,2 +0,1 @@ | ||
exports.Promise = Promise; | ||
function Promise(opts) { | ||
@@ -30,1 +29,2 @@ opts = opts || {}; | ||
} | ||
module.exports = Promise; |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../@types/index.d.ts" /> | ||
const util = require("util"); | ||
@@ -3,0 +2,0 @@ const url = require("url"); |
{ | ||
"name": "@fxjs/orm", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Object Relational Mapping for fibjs", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
{ | ||
"compilerOptions": { | ||
"noImplicitAny": false, | ||
"noImplicitUseStrict": true | ||
"noImplicitUseStrict": true, | ||
"lib": [ | ||
"es6", | ||
"es2015", | ||
"es2016" | ||
] | ||
} | ||
} | ||
} |
264730
44
6612