Type-safe SQL query builder like QueryDSL or JOOQ in Java or Linq in .Net for TypeScript with MariaDB, MySql, Oracle, PostgreSql, Sqlite and SqlServer support.
MIT License
Bot releases are hidden (Show)
Published by juanluispaz over 2 years ago
Documentation changes:
Bug fixes:
Published by juanluispaz over 2 years ago
Changes:
Documentation changes:
Bug fixes:
Published by juanluispaz almost 3 years ago
Changes:
forUseAsInlineAggregatedArrayValue
function, 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 objectaggregateAsArray
aggregation 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 objectuuid
typeorderByFromStringIfValue
, limitIfValue
and offsetIfValue
withOptionalMany
composing rule that allows to use undefined instead of an empty array when no valueDocumentation changes:
mergeType
function documentation warning about the reader evaluate the preferred alternatives firstBug fixes:
contains
method of a string value source is called in MySql/MariaDBsubstrToEnd
, substringToEnd
, substr
and substring
: now the index is according to JavaScript definition (the count start in 0) and the parameters have the correct typePublished by juanluispaz almost 3 years ago
Changes:
*IfValue
, is
, isNot
methods). 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 valuetrueWhenNoValue
and falseWhenNoValue
to allows specify a boolean value when the *IfValue
function 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*IfValue
functionPreview of upcoming changes:
aggregateAsArray
aggregation 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 objectDocumentation changes:
sync
helper function to handle synchronous promises in BetterSqlite3 with a stricter typing and better readabilityBug fixes:
dynamicBooleanExpressionUsing
is asignable to the initial typeasOptional
or asRequiredInOptionalObject
when the type is different to int
Published by juanluispaz almost 3 years ago
Changes:
Documentation changes:
Bug fixes:
stringConcat
when an empty separator is usedPublished by juanluispaz almost 3 years ago
Changes:
replace
method in favour of replaceAll
in the string value source to align with JavaScriptsubstr
and substrToEnd
to the string value source to align with JavaScript and respect the real available implementation in the databasesdynamicBooleanExpresionUsing
method in the connection object. It allows to create programmatically dynamically complex boolean expressions instead of declarative dynamically conditions using the IfValue
functions. It is recommend to use the IfValue
functions when it is possiblemergeType
utility 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 typeDocumentation changes:
Bug fixes:
substring
implementation in the string value sourcePublished by juanluispaz almost 3 years ago
Changes:
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
Bug fixes:
selectOneColum
result type on complex objects (like Date)Published by juanluispaz about 3 years ago
Changes:
defaultSafeIntegers
option in BetterSqlite3)Bug fixes:
treatUnexpectedStringDateTimeAsUTC
connection option (wrongly named: treatUxepectedStringDateTimeAsUTC
)unexpectedUnixDateTimeAreMilliseconds
connection option (wrongly named: uxepectedUnixDateTimeAreMilliseconds
)Published by juanluispaz about 3 years ago
Changes:
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
New examples:
Internal changes:
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
Internal changes:
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
Allows to use in split/compose previously created property using split/compose
Add support to Date and Time management in sqlite using different strategies to represent the value (sqlite doesn't have dedicate types to represent dates and time). The implemented strategies are aligned with the date time support in sqlite allowing to store the information as text (in the local timezone or UTC), as integer (in unix time seconds) or as a real value (in Julian days)
Align method names with convention, where ts-sql-query tries to use well known method names, giving preferences to already existing names in JavaScript, o well known function names in SQL, avoiding abbreviations. Methods with new names (Previous names are still available as deprecated methods):
Previous name | New name |
---|---|
smaller |
lessThan |
smallAs |
lessOrEquals |
larger |
greaterThan |
largeAs |
greaterOrEquals |
mod |
modulo |
lower |
toLowerCase |
upper |
toUpperCase |
ltrim |
trimLeft |
rtrim |
trimRight |
Change some internal type names to improve the readability of the type name in the IDE and in error messages
Implement the compatibility mode on sqlite (enabled by default). When is disabled allows to take advantages of the newer syntax in sqlite. Right now only prisma and better sqlite includes an sqlite compatible
Now is possible create an insert from a select o with multiples values that returns the last inserted id if a compatible sqlite with the returning clause is used
Now is possible create an insert from a select that returns the last inserted id if a compatible sqlite with the returning clause is used
Ensure the MockQueryRunner returns a number when the mock function return no value when an insert, update or delete is executed
Detect invalid results from the mock function returned to the MockQueryRunner
Add support to mock the call to the method isTransactionActive
Documentation changes:
Internal changes:
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
Bug fixes:
IfValue
conditionsPublished by juanluispaz about 3 years ago
Documentation changes:
Bug fixes:
executeSelectNoneOrOne
and the result is nullPublished by juanluispaz about 3 years ago
Changes:
Documentation changes:
executeSelectNoneOrOne
Bug fixes:
Published by juanluispaz about 3 years ago
Changes:
setIfHasValue
, setIfHasValueIfValue
, setIfHasNoValue
, setIfHasNoValueIfValue
, ignoreIfHasValue
, ignoreIfHasNoValue
, ignoreAnySetWithNoValue
Bug fixes:
isTransactionActive
in connections that potentially can nest transaction levelsPublished by juanluispaz about 3 years ago
Documentation changes:
Bug fixes: