- Update npms
- Update npms
- Update npms
- Update postgres-pool npm
- Publish as CJS and ESM
- Upgrade eslint to flat config
- Update npms and dependencies
- Consolidated exports for /decorators, /errors, /metadata, /query, and /types to root
- Update npms
- Update npms
- Update npms
- Update npms
- Handle
null
andundefined
for columns with maxLength. #90 Thanks @tyler-neal! - Update npms
- Added support for optional maxLength constraint when inserting/updating string fields. #89 Thanks @tyler-neal!
- Update npms
- Update npms
- Update npms
- Drop support for Node.js 16
- Throw
QueryError
, with additional metadata - Throw error if query has an empty
or
statement
- Update npms
- Update npms
- Update npms
- Drop support for Node.js 14
- Update npms
- Update npms
- Enable noUncheckedIndexedAccess compiler option
- Update npms
- Fix string comparison where constraint with union values
- Update npms
- Update npms
- Update npms
- Update npms
- Update npms
- Add where clause for conflict resolution. Thanks @shortstuffsushi!
- Update npms
- Add
onConflict
options tocreate()
to supportON CONFLICT DO NOTHING
andON CONFLICT DO UPDATE
- Update npms
- Update npms
- Add ability to override db pool for
count()
- Update npms
- Fix string comparison operators with arrays. Wildcard characters in array values passed to
startsWith
,contains
, andendsWith
were ignored. This fix changes the generated SQL to explicitly evaluate each array value individually usingilike
- Remove unnecessary
await
operators fromthen()
functions
- Update npms
- Update npms
- Update husky to support Apple silicon homebrew package links
- Fix populated entities to be QueryResult
- Improve return types when doing partial selects
- Be less restrictive with dependency versions
- Drop node 12 support
- Fix PromiseLike signatures. Remove ChainablePromiseLike
- Update npms
- Fix to always include populate column names in select query
- Use readonly arrays where possible when building sql
- Update npms
- Update npms
- Update npms
- Add ability to override db pool for
find()
andfindOne()
- Update npms
- Format markdown files
- Update npms
- Lint markdown files
- Update npms
- Set sourceRoot when transpiling Typescript, to help with sourcemap paths
- Fix deprecated faker.js usage
- Update npms
- Update npms
- Add beforeCreate and beforeUpdate static method definitions to Entity.
- Enable typescript lint check:
noImplicitOverride
- Update npms
- Update npms
- Update npms
- Add Node.js v16 to CI tests
- Drop Node.js 10 support
- Enable consistent indexed object style lint rule
- Throw error when trying to populate a one-to-many relationship from
find()
with specific select columns and not including the relation column.
- Allow chaining
populate()
withfind()
calls 🎉 - Add
UNSAFE_withOriginalFieldType()
helper method tofind()
andfindOne()
to retain the original type for a field. This is useful if you have a model field with typestring | Foo
and want to retain the| Foo
part, instead of being forced to strictlystring
. - Add
UNSAFE_withFieldValue()
helper method tofindOne()
to manually set a field value.
- Constrain types for create(), update(), and selects
- Exclude instance functions and entity collections
- Only expect
primitive | Pick<T, ‘id’>
when creating, updating, or in where queries, rather thanprimitive | T
- Shape query result types
- Remove Entity and Entity[] types from property values for find(), findOne(), update(), and destroy() responses
- Add Entity and Entity[] types when populate is called
- Update npms
Breaking Change: The change to create and update values expects a property called id
on subclasses of Entity
.
- Make sort argument optional for chained calls
- Allow sort() argument to be undefined
- Fix object notation for sort() to have properties be optional
- Make
__bigAlEntity
be optional on Entity to avoid undefined errors when using objects as model data
- Fix
select
typings for populate() calls - Changed
Entity
to be an abstract class rather than an interface
NOTE: This is a pretty big breaking change, but v7.0.0 was less than 24h old and was broken, so leaving this as a minor version change.
- Add generic types to select and where. #72 Thanks @krislefeber!
- Add debug environment variable to print sql to console. #73 Thanks @krislefeber!
- Add generic types to returnSelect and sort arguments
- Update npms
- Update npms
- Sort union/intersection members
- Fix jsdocs for create and update
- Update npms
- Change
.destroy()
to not return records by default. Use.destroy({}, { returnRecords: true })
for previous behavior - Return
void
instead ofboolean
when not returning records
- Update npms
- Update npms
- Update npms
- Update npms
- Use prettier to format files
- Create interfaces for Repository and ReadonlyRepository
- Remove interfaces for RepositoriesByModelName and RepositoriesByModelNameLowered
- Update npms
- Use prettier to format files
- Fix issues with
like
and array containing null or empty string. Specifically support negated array type value with null and empty string. - Fix
like
constraint with null value
- Update npms
- Update npms
- Tightened up type definitions for "object" to Record<string, unknown> or more strict definition
- Do not return a string from .count() if the number is greater than safe int
- Update npms & fix lint issues
- Update npms
- Update npms
- Fix jsdoc comments for .populate()
- Update npms
- Update npms
- Update npms
- Update npms
- Make typescript lint rules more strict
- Update npms
- Fix CreateUpdateDelete type to be strict about either returnRecords=false or defined returnSelect
- Update npms
- Throw error when invalid propertyName in query projection
- Update npms
- Update postgres-pool to v2.0.0
- Update npms
- Remove returnSelect requirement when returnRecords=false
- Use classes and decorators to define database models
- Allow repositories to be strongly typed to their database model
- Split readonly repository functionality into a separate class from writeable repository functionality
- Update npms
- Add readonly property to schemas to limit access to create(), update(), destroy() methods
- Update npms
- Fix querying array columns with
like
operator - Add additional array types: string[], integer[], float[], boolean[]
- Fix casing issues with generated Repository and SqlHelper
- Revert explicit export of interfaces/classes: Entity, Model, ModelClassesByGlobalId, and Repository
- Explicit export of interfaces/classes: Entity, Model, ModelClassesByGlobalId, and Repository
- Fix publish path to remove "dist"
- Add type definitions to "dependencies"
- Add binary data type
- Add additional array types as type for defaultsTo
- Add array as type for defaultsTo
- Fix generic type issues due to Typescript 3.5
- Update npms
- Allow .findOne(), .find(), .count(), .update(), and .destroy() to be used in an iterable promise (eg. Promise.all())
- Fix return type for .findOne(), .find(), .count(), .destroy() to not include
undefined
- Update npm dependencies
- Add boolean types as acceptable values for a where clause
- Fix case of import module for initialization function
- Typescript ftw! The API is the same as BigAl v1.x. BigAl v2 is a rewrite in typescript, to provide strong type support. It should be a drop in update to go to v2.
- Use husky to enforce precommit hook for development
- Add
connections
property to initialize method - Use
connection
on model schema to optionally set specific connection pools for each model - Update dependencies
- Update dependencies
- Throw exception when find, update, findOne, and destroy queries receive a string parameter instead of object.
- Fix: Results for model queries should share the same inherited base
- Fix: Querying array types
- Fix: Explicitly cast array values
- Fix: Try to convert float and integer column data to numbers when fetching records
- Fix: Checking if array column equals an empty array
- Allow array values for: like, contains, startsWith, and endsWith
- Fix: Prevent trying to save when create() is called with an empty array
- Fix: Add additional stack trace data when an exception occurs
- Fix: "invalid input syntax for type json" error when setting jsonb column value to an array. See brianc/node-postgres#442
- Update npms to latest versions
- Fix: AND constraint after an OR constraint caused exception
- Fix: Querying date values was not working
- Fix: Querying a property with columnName that is the same as the property name would result in unnecessary sql syntax
- Fix: A query with an empty array should return 0 records. Negated queries with empty arrays will return all records.
- Organize schemas by case-insensitive global id
- Expose schema attributes collection on model instance
- Expose schema attribute functions as methods for results
- Ensure .count() returns number instead of a string (default data type for bigint)
- Fix queries for empty arrays
- Add .count() method
- Initial release