- fix: meta attributes should still be available if subclass-ed by @cyjake in #427
Full Changelog: https://github.com/cyjake/leoric/compare/v2.13.1...v2.13.2
- docs: add search box by @cyjake in #424
- feat: bone.jsonMerge() & bone.jsonMergePreserve() by @cyjake in #425
- fix: reload attribute if instance updated with jsonMerge by @cyjake in #426
Full Changelog: https://github.com/cyjake/leoric/compare/v2.13.0...v2.13.1
- refactor: move json_merge_patch() handling to the spell prepartion phase by @coinkits in #422
- chore: should not reload by default by @coinkits in #423
- @coinkits made their first contribution in #422
Full Changelog: https://github.com/cyjake/leoric/compare/v2.12.3...v2.13.0
- upgrade: mysql2 >= 3.9.4 by @cyjake in #420
- feat: support mysql2 v3 for security update by @fengmk2 in #419
Full Changelog: https://github.com/cyjake/leoric/compare/v2.12.2...v2.12.3
- chore: export { hookNames } by @cyjake in #416
Full Changelog: https://github.com/cyjake/leoric/compare/v2.12.1...v2.12.2
- fix: export more ts type definitions by @JimmyDaddy in #411
- Update starter.md by @zhennann in #412
- fix: type error in validate when using min max by @chen201724 in #413
- feat: support JSON_VALUE(j, '$.a' RETURNING CHAR(50)) by @cyjake in #414
Full Changelog: https://github.com/cyjake/leoric/compare/v2.12.0...v2.12.1
- chore: export main entry point only by @cyjake in #404
- docs: more examples about typescript support by @cyjake in #405
- chore: improve test coverage after migrating ts project by @cyjake in #406
- feat: ignore json parse error if jsonType.ignoreError is positive by @cyjake in #409
Full Changelog: https://github.com/cyjake/leoric/compare/v2.11.5...v2.11.6
- refactor: turn on compilerOptions.strict by @cyjake in #403
Full Changelog: https://github.com/cyjake/leoric/compare/v2.11.4...v2.11.5
- fix: fix scope type definitions by @JimmyDaddy in #402
Full Changelog: https://github.com/cyjake/leoric/compare/v2.11.3...v2.11.4
- chore: export { WhereConditions } by @cyjake in #400
Full Changelog: https://github.com/cyjake/leoric/compare/v2.11.2...v2.11.3
- docs: introduce @midwayjs/leoric by @cyjake in #399
- fix: don't overwrite primaryKey with LAST_INSERT_ID() if exists by @cyjake in #398
Full Changelog: https://github.com/cyjake/leoric/compare/v2.11.1...v2.11.2
- fix: typo DataType for AbstractDriver by @vagusX in #390
- fix: wrong export from sequelize by @vagusX in #391
- fix: typo in hooks.md by @vagusX in #392
Full Changelog: https://github.com/cyjake/leoric/compare/v2.11.0...v2.11.1
- feat: support browser and support sql.js driver by @vagusX in #386
- fix: remove unscoped fn in src/adapters/sequelize.js by @vagusX in #387
- fix: join conditions containing fields of base model should be allowed by @cyjake in #388
Full Changelog: https://github.com/cyjake/leoric/compare/v2.10.3...v2.11.0
- feat: try to use structuredClone first by @fengmk2 in #384
- fix: avoid ts type detect error by @fengmk2 in #385
Full Changelog: https://github.com/cyjake/leoric/compare/v2.10.2...v2.10.3
- fix: order clause need be repeated on the main query by @cyjake in #383
Full Changelog: https://github.com/cyjake/leoric/compare/v2.10.1...v2.10.2
- fix: retain where conditions when sharding key is necessary by @cyjake in #381
- fix: select everything when forming subspell by @cyjake in #382
Full Changelog: https://github.com/cyjake/leoric/compare/v2.10.0...v2.10.1
- feat: add db pacakges to peerDependencies by @fengmk2 in #375
- feat: support manual rollback & commit for transaction, fix #371 by @JimmyDaddy in #376
- feat: optimize join query parsing fix #378 by @JimmyDaddy in #380
Full Changelog: https://github.com/cyjake/leoric/compare/v2.9.2...v2.10.0
- fix: types for findAndCountAll by @vagusX in #372
- fix: adapt facebook hermes or metro bundler for loop by @JimmyDaddy in #374
Full Changelog: https://github.com/cyjake/leoric/compare/v2.9.1...v2.9.2
- fix: fix Bone.create(values) params type definitions by @JimmyDaddy in #369
- chore: export Utility Type BoneInstanceValues by @JimmyDaddy in #370
Full Changelog: https://github.com/cyjake/leoric/compare/v2.9.0...v2.9.1
- fix:
tinytext
type error by @JimmyDaddy in #364 - fix: date strings should be parsed with system time zone considered by @cyjake in #365
- feat: support multiple level inherent by @JimmyDaddy in #366
- fix:
cast/uncast
STRING and TEXT with non-string type value, and some type definitions by @JimmyDaddy in #368
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.8...v2.9.0
- fix: join query with select columns should include order columns by @cyjake in #360
- docs: support switchable dark theme, at web app level by @cyjake in #359
- fix: @Column() should not tamper parent attributes directly by @cyjake in #362
- fix: bone.update({ deletedAt: null }) and likewise methods should work by @cyjake in #363
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.7...v2.8.8
- fix: enable strictNullChecks by @cyjake in #357
- fix: declaration types of realm.query() and static update values by @cyjake in #358
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.6...v2.8.7
- fix: new Realm({ sequelize: true }).Bone == Realm.SequelizeBone by @cyjake in #349
- fix: edge cases in attribute.equals() by @cyjake in #350
- fix: bone.attribute(name, value?) type infer with this[name] by @cyjake in #351
- fix: ts type definitions by @JimmyDaddy in #352
- fix: this.attribute(name) should fallback to Literal by @cyjake in #353
- fix: type definitions for columns constraint by @JimmyDaddy in #355
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.5...v2.8.6
- fix: deletedAt should always be checked when associating models by @cyjake in #347
- fix: generic type for getDataValue by @vagusX in #346
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.4...v2.8.5
- fix: Literal type should not contain
object
& ResultSet should be derived from instance values by @cyjake in #345
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.3...v2.8.4
- fix: AssociationOptions.select? should be supported by @cyjake in #343
- fix: return type of realm.query, realm.transaction, and Bone.transation by @cyjake in #344
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.2...v2.8.3
- fix: AssociateOptions in HasMany, BelongdsTo decorators by @cyjake in #341
- fix: invokable dataType in decorators should work and dts fix by @JimmyDaddy in #342
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.1...v2.8.2
- fix: metro exports error by @JimmyDaddy in #339
- fix: Model.count(field) in sequelize adapter by @cyjake in #340
Full Changelog: https://github.com/cyjake/leoric/compare/v2.8.0...v2.8.1
- feat: refactor type definitions to export SequelizeBone, complete spell type definitions and fix index hints logic by @JimmyDaddy in #337
- fix: throw error if token is not expected when parse expr by @cyjake in #338
Full Changelog: https://github.com/cyjake/leoric/compare/v2.7.3...v2.8.0
- fix: should skip loading models that is loaded before by @cyjake in #335
Full Changelog: https://github.com/cyjake/leoric/compare/v2.7.2...v2.7.3
- Update associations.md by @dxhuii in #331
- refactor: refactor type definitions and fix unique not work in columnOptions by @JimmyDaddy in #332
- fix: declare more exported functions such as isBone and heresql by @cyjake in #333
- fix: INTEGER like data type and STRING extra options didn't work in polymorphism, fix decorators ColumnOptions.type to support invokable by @JimmyDaddy in #334
- @dxhuii made their first contribution in #331
Full Changelog: https://github.com/cyjake/leoric/compare/v2.7.1...v2.7.2
- fix: projects might have strictPropertyInitialization set to true by @cyjake in #329
- fix: types for validate in
Column
decorator by @vagusX in #330
- @vagusX made their first contribution in #330
Full Changelog: https://github.com/cyjake/leoric/compare/v2.7.0...v2.7.1
- fix: glue code for opts.dialectModulePath by @cyjake in #326
- fix: primaryKey in upsert values should be validate in sqlite and postgres by @JimmyDaddy in #328
- feat: change DataTypes to ts and complete decorators type definitions by @JimmyDaddy in #319
Full Changelog: https://github.com/cyjake/leoric/compare/v2.6.3...v2.7.0
- fix: aggregator not parse null result by @killagu in #322
- test: switch the auth protocol of test mysql database by @cyjake in #323
- feat: add leoric_bone meta data to Bone by @JimmyDaddy in #324
- docs: fix declarations of findOne(primaryKey) & findOne({ $or }) by @cyjake in #325
Full Changelog: https://github.com/cyjake/leoric/compare/v2.6.2...v2.6.3
- fix: format select with out * if use aggreator by @killagu in #320
- fix: fix transaction typing by @killagu in #321
- @killagu made their first contribution in #320
Full Changelog: https://github.com/cyjake/leoric/compare/v2.6.1...v2.6.2
- build: switch to latest postgres by @cyjake in #316
- fix: fix [bug] init models with bone class should work #317 by @JimmyDaddy in #318
Full Changelog: https://github.com/cyjake/leoric/compare/v2.6.0...v2.6.1
- feat: support export sql query template in logger by @JimmyDaddy in #314
- fix: fix uncast date string without milliseconds error by jsCore in Android/iOS by @JimmyDaddy in #315
Full Changelog: https://github.com/cyjake/leoric/compare/v2.5.0...v2.6.0
- feat: support disconnect and fix timestamps init by @JimmyDaddy in #313
Full Changelog: https://github.com/cyjake/leoric/compare/v2.4.1...v2.5.0
- fix: realm.Bone.DataTypes should be invokable, Invokable.TYPE.toSqlString() get wrong default length(1), DataType definitions by @JimmyDaddy in #307
Full Changelog: https://github.com/cyjake/leoric/compare/v2.4.0...v2.4.1
- feat: support custom driver by @JimmyDaddy in #304
- chore: update build status badge by @snapre in #305
- feat: export more ts type definitions and use deep-equal module by @JimmyDaddy in #306
- @snapre made their first contribution in #305
Full Changelog: https://github.com/cyjake/leoric/compare/v2.3.2...v2.4.0
- fix: order by raw with mix-type array in sequelize mode by @JimmyDaddy in #298
- docs: monthly updates and example about egg-orm usage with TypeScript by @cyjake in #299
- docs: monthly updates in en & docmentation about typescript support by @cyjake in #300
- fix: raw query should format replacements with extra blank by @JimmyDaddy in #301
- docs: elaborate on querying by @cyjake in #302
- feat: transaction should return result by @JimmyDaddy in #303
Full Changelog: https://github.com/cyjake/leoric/compare/v2.3.1...v2.3.2
- fix: mysql2 Invalid Date compatible by @JimmyDaddy in #291
- fix: order by raw in sequelize mode by @JimmyDaddy in #292
- fix: bulk update query conditions duplicated in sequelize mode by @JimmyDaddy in #293
- fix: bulk destroy query conditions duplicated in sequelize mode by @JimmyDaddy in #295
- fix: drop column if not defined in attributes when alter table by @cyjake in #296
Full Changelog: https://github.com/cyjake/leoric/compare/v2.3.0...v2.3.1
- feat: model declaration with decorators by @cyjake in #287
- feat: add VIRTUAL data type by @JimmyDaddy in #289
- fix: create instance dirty check rule fix by @JimmyDaddy in #290
Full Changelog: https://github.com/cyjake/leoric/compare/v2.2.3...v2.3.0 2.2.3 / 2022-03-01
- fix: normalize attribute defaultValue by @cyjake in #285
- fix: instance beforeUpdate hooks should not modify any Raw if there are no Raw assignment in them by @JimmyDaddy in #283
Full Changelog: https://github.com/cyjake/leoric/compare/v2.2.2...v2.2.3
- fix: tddl gives misleading information_schema.columns.table_name by @cyjake in #284
Full Changelog: https://github.com/cyjake/leoric/compare/v2.2.1...v2.2.2
- fix: realm.DataTypes should be invokable by @cyjake in #282
Full Changelog: https://github.com/cyjake/leoric/compare/v2.2.0...v2.2.1
- fix: add missing
password
field forConnectOptions
by @luckydrq in #280 - feat: integer types (mostly mysql specific) by @cyjake in #281
Full Changelog: https://github.com/cyjake/leoric/compare/v2.1.1...v2.2.0
- fix: fix #274 update with fields option by @JimmyDaddy in #275
- fix: upsert should set createdAt by default while createdAt not set by @JimmyDaddy in #277
- fix: previousChanges should check instance is new record or not while specific attributes' values were undefined by @JimmyDaddy in #276
- docs: add types for realm by @luckydrq in #278
- @luckydrq made their first contribution in #278
Full Changelog: https://github.com/cyjake/leoric/compare/v2.1.0...v2.1.1
- feat: fix #270 sequelize mode bulkBuild by @JimmyDaddy in #273
- fix: mysql delete/remove/destroy with limit and orders by @JimmyDaddy in #272
Full Changelog: https://github.com/cyjake/leoric/compare/v2.0.4...v2.1.0
- fix: fix unit test error by @LB4027221 in #269
- fix: attribute.defaultValue should be set when init attributes by @cyjake in #271
Full Changelog: https://github.com/cyjake/leoric/compare/v2.0.3...v2.0.4
- fix: default updatedAt to new date if model has no createdAt by @LB4027221 in #268
- @LB4027221 made their first contribution in #268
Full Changelog: https://github.com/cyjake/leoric/compare/v2.0.2...v2.0.3
- fix: order by alias should not throw by @cyjake in #255
- fix: fix #257 DataType.uncast should skip Raw type at type checking by @JimmyDaddy in #258
- docs: async function in transaction by @cyjake in #259
- fix: fixed #256 static create instance should check all default attri… by @JimmyDaddy in #262
- fix: fix #260 UPDATE with LIMIT and ORDER should be formatted(mysql only) by @JimmyDaddy in #261
- refactor: keep the UPDATE ... ORDER BY ... LIMIT to mysql driver by @cyjake in #264
- fix: fix #263 upsert attributes should use defaultValue while there i… by @JimmyDaddy in #265
- fix: fix restore Error
Undefined attribute "deletedAt"
by @JimmyDaddy in #267 - fix: type checking adaption by @JimmyDaddy in #266
Full Changelog: https://github.com/cyjake/leoric/compare/v2.0.1...v2.0.2
- fix: format numeric result by @JimmyDaddy in #253
- fix: should still return number if value is '0.000' by @cyjake in #254
Full Changelog: https://github.com/cyjake/leoric/compare/v1.15.1...v2.0.1
- breaking: model.sync add force/alter option by @SmartOrange in #224
- breaking: logQueryError(err, sql, duration, options) by @cyjake in #237
- test: add utf8mb4 test cases by @fengmk2 in #239
- Merge 1.x changes by @cyjake in #249
- @SmartOrange made their first contribution in #222
Full Changelog: https://github.com/cyjake/leoric/compare/v1.15.1...v2.0.0
- fix: fix #242 date string format by @JimmyDaddy in #243
- fix: update with empty conditions by @JimmyDaddy in #241
- fix: silent option's priority should be lower than valueSet by @JimmyDaddy in #244
- fix: information_schema.columns.datetime_precision by @cyjake in #246
- fix: should not hoist subquery if query is ordered by external columns by @cyjake in #247
Full Changelog: https://github.com/cyjake/leoric/compare/v1.15.0...v1.15.1
- feat: make duration in precise milliseconds by @fengmk2 in #236
- fix: spell.increment() & spell.decrement() @cyjake #234
- fix: bulkCreate should adapte empty data @JimmyDaddy #232
Full Changelog: https://github.com/cyjake/leoric/compare/v1.14.4...v1.14.5
- test: PostgreSQL v14 test case compatibility by @cyjake #230
- fix: turn off subquery optimization if query criteria contains other column by @cyjake #229
- fix: bone.changed() return
false | string[]
type by @fengmk2 #231
Full Changelog: https://github.com/cyjake/leoric/compare/v1.14.3...v1.14.4
- fix: logger.logQuery should be guarded in case of error by @SmartOrange in #222
- fix: findOne without result should return null by @JimmyDaddy in #225
- fix: Literal should support bigint type by @fengmk2 in #226
- fix: select((name: string) => boolean) by @cyjake in #227
Full Changelog: https://github.com/cyjake/leoric/compare/v1.14.2...v1.14.3
- fix: accept timestamps in snake case by @cyjake in #221
Full Changelog: https://github.com/cyjake/leoric/compare/v1.14.1...v1.14.2
- docs: export { Collection } by @cyjake in #220
Full Changelog: https://github.com/cyjake/leoric/compare/v1.14.0...v1.14.1
Two options regarding Model.init()
were added in this release:
class User extends Bone {}
User.init({ name: STRING }, {
timestamps: true, // which is the default
paranoid: true, // which default to `false`
});
assert.deepEqual(Object.keys(User.attributes), [
'id',
'name',
'createdAt',
'updatedAt',
'deletedAt',
]);
- docs: update 'primayKey' typos by @freshgum-bubbles in #211
- docs: DataTypes definitions in d.ts by @cyjake in #210
- fix: fix#209 sequelize mode should update all changed fields in instance update method by @JimmyDaddy in #212
- fix: fix #213 findAndCountAll should ignore attributes by @JimmyDaddy in #214
- fix: opts.connectTimeout by @cyjake in #216
- fix: reload instance with sharding key should not throw by @cyjake in #217
- feat: timestamps should be defined by default by @cyjake in #218
- fix: instance.reload() should not rely on
static findOne()
by @cyjake in #219
- @freshgum-bubbles made their first contribution in #211
Full Changelog: https://github.com/cyjake/leoric/compare/v1.13.5...v1.14.0
- docs: enhance aggregation query types & fix raw query result type by @cyjake in #208
Full Changelog: https://github.com/cyjake/leoric/compare/v1.13.4...v1.13.5
- docs: spell & model methods should be generic by @cyjake in #206
- docs: enhance query options, instance type, and toJSON() result type by @cyjake in #207
This version brings correct (and hopefully better) typescript definitions, with the dts checked continuously at test/types tests. With this version, users that have model types correctly pinned at Bone will get code completion including class fields. Such as:
Full Changelog: https://github.com/cyjake/leoric/compare/v1.13.3...v1.13.4
- refactor: persist edge cases of type casting in integration tests by @cyjake in #202
- docs: renaming attributes by @cyjake in #203
- fix: JSON.uncast(string) should not serialize twice by @cyjake in #205
Full Changelog: https://github.com/cyjake/leoric/compare/v1.13.2...v1.13.3
- fix: attribute.uncast([]) and realm.connect with synchronized models by @cyjake in #201
Full Changelog: https://github.com/cyjake/leoric/compare/v1.13.1...v1.13.2
- fix: skip connecting if models are synchronized already by @cyjake in #200
Full Changelog: https://github.com/cyjake/leoric/compare/v1.13.0...v1.13.1
- docs: monthly updates of 2021.09; support dark mode by @cyjake in #196
- feat: coerce literal values into accurate attribute type by @cyjake in #197
- fix: dispatched result should be in attribute names by @cyjake in #198
Full Changelog: https://github.com/cyjake/leoric/compare/v1.12.0...v1.13.0
- feat: support custom fields query and sequelize mode export rawAttributes (#192)
- refactor: collection format query result (#194)
- refactor: object condition parsing and expression formatting (#191)
This version fixes lots of issues regarding logical operator in object conditions.
- fix: logical operator with multiple conditions such as (#190)
- fix: sequelize mode support HAVING, and select fields raw sql support (#187)
- fix: support len validator (#188)
- fix: normalize logical operator conditions before formatting with spellbook (#186)
- feat: support BINARY(length), VARBINARY(length), and BLOB (#169)
- fix: logic operate should adapt one argument (#183)
- fix: Bone.load() should be idempotent, make sure associations is intact (#184)
- fix: selected instance isNewRecord is false (#182)
- fix: set options.busyTimeout to mitigate SQLITE_BUSY (#176)
- fix: turn on long stack trace of sqlite driver (#175)
- docs: how to contribute (#180)
- feat: SQLite driver should emit "connection" event when new connection is created (#168)
- fix: bulkCreate(...records) should recognize custom setters (#168)
- fix: attribute.equals() check should ignore defaultValue (#172)
should've been a major release but since existing users have all migrated to the new api...
- breaking: drop the deprecated
Model.describe()
(#167)
- feat: silent option fix #164 (#165)
- feat: binary type (#166)
- revert: drop Driver#recycleConnections due to poor interoperability (#162)
- fix: validator call array arguments (#160)
- feat: close connections that exceeds opts.idleTimeout (#159)
- feat:
opts.connectionLimit
support for SQLite (#159) - feat: raw query relpacements, closes #149 (#155)
- fix: upsert created_at default (#154)
- test: validator unit test (#157)
- test: setup_hooks unit test (#158)
- fix: prevent from calling Date.prototype.toJSON (#153)
- fix: subclassing data type in dialects (#145)
- fix: where('width / height >= 16 / 9') (#144)
- docs: logging and sequelzie adapter (zh) (#142)
- test: include test/unit/utils (#143)
- test: more tests cases about sequelize adapter (#141)
- fix: define assign Bone.models #140
- refactor: connect({ Bone }) still necessary (#139)
- fix: formatting select join with subqueries should not tamper the subquery itself (#138)
- fix: describe table with more compatible syntax (#137)
- fix: transaction option passing in sequelize adapter (#136)
- fix: this.Model and proper Model.describe() (#135)
- fix: convert datetime in seconds/milliseconds back to Date (#134)
- fix: renamed attribute should remain enumerable (#133)
- fix: collection convert should handle tddl results as well (#132)
- feat: support class static attributes and hooks (#131)
- fix: names defined in Bone.attributes should always be enumerable (#128)
- chore: add quality badge to readme (#129)
- fix: leave the getter properties defined in class syntax as is (#127)
- fix: export Logger and Spell to let users intercept lower level api calls (#126)
- feat: provide Bone.pool to be backward compatible with v0.x (#124)
- feat: complete bone/spine.restore and Bone API type definitions (#125)
- feat: support more data types (mediumtext, mediumint, char, date...) (#123)
- refactor: simplify legacy timestamps support (#120)
- refactor: do not subclass Bone unless asked specifically (#120)
- feat:
realm.raw('SELECT ...')
andModel.raw('SELECT ...')
(#94) - feat: support multiple order rules in one single string or one-dimensional array (#92)
- feat:
Model.truncate()
now uses TRUNCATE if possible - feat:
Model.find().optimizerHints('SET_VAR(foreign_key_checks=OFF)')
- fix: Bone.bulkCreate() should not throw when called with non attribute (#117)
- fix: batch upsert (#108)
- fix: make sure connection is passed around in all queries carried out within transaction (#105)
- fix: update, sequelize mode get API, destroy compitable (#104)
- fix:
setDataValue
in sequelize adapter should not check prop name strictly - refactor: spell_insert (#118)
- docs: about egg-orm & migrations (#119)
- docs: revise instructions for installing Jekyll (#111)
- docs: migrations, validations, hooks, and sequelize adapter (#103)
- docs: contributing guides
- feat: hook support
- feat: dirty check (
changes()
&previousChanges()
) - feat: compatible with mysql longtext conversion
- feat: NOT condition
- feat:
Realm.prototype.transaction()
with async function support - feat:
Realm.prototype.query()
for raw queries - feat:
logger.logQuery(sql, duration, { Model, command })
- feat:
logger.logQueryError(sql, err, duration, { Model, command })
- feat: JSON and JSONB data types
- feat: support
stringifyObjects
option for mysql client - feat: aggregate functions for sequelize adapter
- feat:
Spell.prototype.nodeify()
- fix: replace
deep-equal
(which is bloated) withutil.isDeepStrictEqual
- fix: driver.alterTable() with multiple columns to add in SQLite
- fix: bulkCreate in sequelize shim
First major release. Let's get serious with semver.
- feat: logger.logQuery(sql, duration) & logger.logQueryError(sql, err)
- fix:
connect({ sequelize, dialect, client })
to allow mandatory sqlite client - fix: prevent queries being performed unless model is correctly connected
- fix: drop the default and unused
require('sqlite3')
- fix:
connect({ client: '@journeyapps/sqlcipher' })
- feat:
Bone.sync()
to synchronize model with database - feat:
Bone.createMigrationFile()
to create migration file - feat:
Bone.migrate()
to run migrations - feat:
Bone.bulkCreate()
to bulk insert records - feat:
require('leoric')
now exportsRealm
to connect with multiple databases - feat:
realm.define()
to define models in an old fashioned way - feat:
realm.connect()
to connect with database - feat: SQLite support without hacking node-sqlite3
- feat:
Bone.DataTypes
for type references - feat:
Bone.init()
to initialize models - feat: an adaptor to use Leoric in (partially) Sequelize complaint API
- refactor: a complete re-write of JOIN queries
- refactor: added
Bone.driver
to better encapsulate and planish database nuances
- fix: prevent primary key from being overridden with incorrect
LAST_INSERT_ID()
- fix: append default scope when declaring relations, fixes #10
- fix: prevent Bone.dispatch from creating duplicated records of main table
- feat:
Spell#orWhere()
andSpell#orHaving()
- feat: arithmetic operators
- feat: unary operators such as unary minus
-
and bit invertion~
- fix: unset attribute should be overwritable
- fix:
attributeChanged()
should be false if attribute is unset and not overwritten - fix: subclass with incomplete getter/setter should be complemented
- fix: sharding key validation on
Bone.update()
andBone.save()
- fix: sharding key should be along with primary key on
bone.remove()
- fix:
Bone.cast()
should leavenull
as is - fix:
INSERT ... UPDATE
withid = LAST_INSERT_ID(id)
in MySQL - fix:
Model.find({ name: { $op1, $op2 } })
object conditions with multiple operators - fix: prefixing result set with qualifiers if query contains join relations and is not dispatchable
- fix:
Spell#$get(index)
with LIMIT - doc:
Model.transaction()
- doc: definition types with
index.d.ts
- feat: premature sharding key validation
- fix: output complete SQL instead of parameterized query with values.
- fix: both
connect({ model })
andconnect({ models })
are allowed. - doc: no more
.findOrCreate()
, just.upsert()
- doc: table of contents with kramdown's
{:toc}
- chore: droped experimental sqlite3 support
- feat: PostgreSQL support
- feat: Transaction support
- upgrade: (forked) SQLite client updated to SQLite 3.24
- feat: SQLite support with a forked sqlite3
- feat: mysql2 support (which is trivial since both mysql and mysql2 share the same API)
- refactor: Spell now formats SQL with the literals separated, which gets escaped by the corresponding client itself later on.
- breaking: renaming
- fix: implement
query.batch()
as async iterator - fix:
NOT (expr)
- fix:
IFNULL(foo, default)
- fix: support
.select(name[])
,.select(name => {})
, and.select("...name")
- doc:
Model => className
in association options - doc: use jsdoc to generate docs/api
- doc:
.include()
- refactor:
{ type: 'op', name: 'as' }
renamed to{ type: 'alias' }
- feat:
{ type: 'mod' }
for modifier, currently onlyDISTINCT
is recognized - feat: unary operators like
!
andNOT
- feat:
IS
andIS NOT
- fix: logic operator precendences
- fix: polymorphic hasMany({ through }) relations
- fix: dispatching multiple results with joins correctly
- feat: proper
.first
,.last
,.all
, and.get(index)
- fix: accept
Date
,boolean
, andSet
values - fix:
Model.unscoped
- fix:
Model.remove({}, true)
should be unscoped
- refactor: encapsulate column names. Keep them from the users even if the query results can not be dispatched.
- fix: complicated groups with joins should discard the use of subquery.
- fix: camelCase should replace globally
- fix: avoid missing attribtue exception when toJSON/toObject
- fix: should format condition arrays by hand instead of hand it over to formatExpr
- fix: whereConditions of subquery should retain the order of the whereConditions in major query
- fix: calculated columns should be kept in the final columns when sorting out the attributes
- fix: doesn't depend on co anymore
- fix:
select distict foo from table
; - fix:
where (a = 1 or a = 2) and b = 3
; - doc: a syntax table to provide a better glance over the querying ability.
- fix: copy left table's orders into subquery to make order/limit work when combined.
- fix: errors should be thrown when accessing attributes that weren't selected at the first place.
- refactor: automatic versioning on spells. When client calls query methods with chaining, new versions of spell gets duplicated. Makes reuse of spells possible.
- doc: english verion is almost complete http://cyj.me/leoric.
- Initial version, covers basic usage such as model authoring, database connection, query interface, and association.