- Bump dependencies
Breaking changes:
- Use
node-promise-mysql
to handle promisifing functions - Update and remove non-needed typings
- Export
BuilderTypes
directly
- Bump dependencies
- Add husky git hooks
- Bump dependencies
- BREAKING: Remove
returnEmptyArrayForNoResults
- Bump dependencies
- Format code
- Make
BuilderTypes
options optional
- Update docs
- Add
returnEmptyArrayForNoResults
toConnectionConfig
- Minor code improvements
- add
QueryBuilder#resetQuery
method - throw error when no query string is present
- bump dependencies
- Add
debugExec
to debug theQueryBuilder#exec
method - Add
QueryBuilder#createTableIfNotExists
method - Add
ifExists
option toQueryBuilder#drop
method
- Add
QueryBuilder#whereLike
method
- Add
QueryBuilder#createTable
andQueryBuilder#addColumnsToTable
methods - Add
string
,int
,text
,timestamp
,date
,json
andcustomType
forQueryBuilder#createTable
- Update documentation
See documentation for new methods
- Support for
Tables
type.
View the example!
import { createConnection } from "@casper124578/mysql.ts";
type MyTables = "books" | "authors";
async function init() {
// pass it in here!
const connection = await createConnection<MyTables>({
/* options */
});
// Works!
const results = await connection.query().select("*").from("books").exec();
// Typescript error!
const other = await connection.query().select("*").from("nope").exec();
}
- Use
string | boolean | number
instead ofstring
forand
,or
andwhere
- Add
or
,renameTable
,drop
,count
,dropColumn
methods toQueryBuilder
- Export
MysqlError
,OkPacket
,QueryOptions
types frommysql
- Make
QueryBuilder#update
&QueryBuilder#insert
Partial<T>
- better TypeScript support
Breaking change:
query().exec<T>()
has been replaced with query<T>().exec()
for better TypeScript support
- const results = await connection.query().select("*").exec<T>() ...
+ const results = await connection.query<T>().select("*").exec() ...
- Add new methods:
beginTransaction
,changeUser
,commit
,ping
,rollback
,statistics
- Add
StatisticsPacket
andChangeUserOptions
typings - Able to pass options to
QueryBuilder#exec
- Export correct types
Breaking change:
<Connection>.query
has been replaced with <Connection>.query()
- const results = await connection.query.select("*") ...
+ const results = await connection.query().select("*") ...
- fix: cleanup query after
exec
- Add missing exports
- Add missing links to package.json
- Update documentation
- Initial release
- Add documentation
- Initial version