Releases: juanluispaz/ts-sql-query
Releases · juanluispaz/ts-sql-query
1.30.0
Bug fixes:
- Fix optional join not omitted when an
IfValueis used and there is no value
1.29.0
Changes:
- Export helper types in extras to retrieve row types when insert, update and select
- Include timestamps in
LoggingQueryRunnercallbacks - Make the
ConsoleLogQueryRunnermore configurable so that it can output results, timestamps and durations as well
Bug fixes:
- Fix insert default values on TypeScript 3.5 or higher
- Unable to compile ts-sql-query with TypeScript 4.7
1.28.0
Changes:
- Add compatibility mode to MySql to avoid use the with clause not supported by MySql 5
- Add support to reference current value and value to insert in an insert on conflict do update
1.27.0
Re-release 1.27.0 due a mkdocs bug.
1.27.0 changes:
Documentation changes:
- Add the insert on conflict methods to the supported operation documentation page
Bug fixes:
- Fix TS4029 error when you need to emit the type definition (for use in a library) of the files that contains the database, tables and views
- Avoid database connection leaks due a forbidden concurrent usage of a pooled query runner
1.27.0
Documentation changes:
- Add the insert on conflict methods to the supported operation documentation page
Bug fixes:
- Fix TS4029 error when you need to emit the type definition (for use in a library) of the files that contains the database, tables and views
- Avoid database connection leaks due a forbidden concurrent usage of a pooled query runner
1.26.0
Changes:
- Add support to "insert on conflict do nothing" and "insert on conflict do update" on PostgreSql, Sqlite, MariaDB and MySql
- Add support to specify raw sql fragment in the order by; allowing complex order by in the select query
- Allow insert, update and delete in raw sql fragments
Documentation changes:
- Add a demo video to the documentation
Bug fixes:
- Fix infinite instantiation in newer versions of TypeScript
1.25.0
Changes:
- Implements
forUseAsInlineAggregatedArrayValuefunction, that allows to transform a query in create an array value of a single column (if it is single-column query), or an object where the rows are represented as an object - Implements
aggregateAsArrayaggregation function, that allows to create an value that contains, per each row, an array of a single column, or an array with several columns represented as an object - Add support to the
uuidtype - Add support to
orderByFromStringIfValue,limitIfValueandoffsetIfValue - Add support to subqueries that contains with clause with external/contextual dependencies
- Add support to compose over optional properties
- Add support to
withOptionalManycomposing rule that allows to use undefined instead of an empty array when no value - Detect invalid queries in SqlServer, Oracle and MariaDB when an outer reference is used to create a query that is not supported by the database because no outer references are allowed in inner with, or, in MariaDB, no outer references are allowed in inner from
- Combine multiple concat expressions in a single concat function call in MySql and MariaDB
Documentation changes:
- Add a note in the
mergeTypefunction documentation warning about the reader evaluate the preferred alternatives first
Bug fixes:
- Fix invalid query when a table alias is specified in Oracle
- Fix invalid recursive query in Sql Server
- Fix invalid recursive query in Oracle
- Fix invalid query when
containsmethod of a string value source is called in MySql/MariaDB - Fix
substrToEnd,substringToEnd,substrandsubstring: now the index is according to JavaScript definition (the count start in 0) and the parameters have the correct type - Fix invalid type when a mathematical function is used and the provided value is not the same type that the column
1.24.0
Changes:
- Manage complex projections in compound operations (union, intercept, etc.)
- Ensure the dynamic conditions cannot create conditions when null/undefined values are provided to functions that doesn't expect it
- Detect when null/undefined values are provided to an operation with a value coming from a left join where a not null/undefined value must be provided
- Deprecate all value source methods overload that can produce unexpected falsy/null values because the provided value in JavaScript is null or undefined. Now all value source methods doesn't admit null or undefined values (except the
*IfValue,is,isNotmethods). In the odd case you need to use a nullable value from JavaScript, and you want to maintain the falsy/null output use an optional constant with the JavaScript value - Add the methods
trueWhenNoValueandfalseWhenNoValueto allows specify a boolean value when the*IfValuefunction produces no value. This can help to manage optional values coming from JavaScript in complex logic without need to use the deprecated methods that can produce unexpected falsy/null values - Allows to negate the result of a
*IfValuefunction - Improve boolean expression reduction when the negate method is used
- Detect invalid columns to be returned in a select (non-string key)
Preview of upcoming changes:
- Implements
aggregateAsArrayaggregation function, that allows to create an value that contains, per each row, an array of a single column, or an array with several columns represented as an object - Add support to subqueries that contains with clause with external/contextual dependencies
Documentation changes:
- Clean up
synchelper function to handle synchronous promises in BetterSqlite3 with a stricter typing and better readability
Bug fixes:
- Ensure any boolean operation apply over a boolean created using
dynamicBooleanExpressionUsingis asignable to the initial type - Fix invalid result type of calling
asOptionalorasRequiredInOptionalObjectwhen the type is different toint - Fix BetterSqlite3 implementation that returns a real promise instead of a synchronous promise when there is no columns to set
1.23.0
Changes:
- Add support to complex projections, that allows to create inner objects in the result of a query
- Detect invalid query when a table in the from of an update appears in the returning clause in sqlite. Now it verify the restriction 7 of the returning clause in Sqlite
- Add support for Prisma 3
- Add support for the interactive transactions in Prisma
Documentation changes:
- Add test strategy information
Bug fixes:
- Fix MariaDB/MySql
stringConcatwhen an empty separator is used
1.22.0
Changes:
- Deprecate
replacemethod in favour ofreplaceAllin the string value source to align with JavaScript - Add the
substrandsubstrToEndto the string value source to align with JavaScript and respect the real available implementation in the databases - Add support to create complex dynamic boolean expression using the
dynamicBooleanExpresionUsingmethod in the connection object. It allows to create programmatically dynamically complex boolean expressions instead of declarative dynamically conditions using theIfValuefunctions. It is recommend to use theIfValuefunctions when it is possible - Add
mergeTypeutility function to deal with advanced dynamic queries when a variable ended with type a union of several types of value source. This function allows to resolve the union type in a single value source type
Documentation changes:
- Combine all topics related to dynamic queries in a single page to avoid confusion
- Improve documentation style
Bug fixes:
- Fix broken
substringimplementation in the string value source