Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added some small additions about supporting better-sqlite3 #369

Merged
merged 1 commit into from Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 19 additions & 2 deletions sections/installation.js
Expand Up @@ -28,6 +28,7 @@ export default [
$ npm install pg
$ npm install pg-native
$ npm install sqlite3
$ npm install better-sqlite3
$ npm install mysql
$ npm install mysql2
$ npm install oracledb
Expand Down Expand Up @@ -99,20 +100,36 @@ export default [
},
{
type: "info",
content: "Note: When you use the SQLite3 adapter, there is a filename required, not a network connection. For example:"
content: "Note: When you use the SQLite3 or Better-SQLite3 adapter, there is a filename required, not a network connection. For example:"
},
{
type: "code",
language: "js",
content: `
const knex = require('knex')({
client: 'sqlite3',
client: 'sqlite3', // or 'better-sqlite3'
connection: {
filename: "./mydb.sqlite"
}
});
`
},
{
type: "info",
content: "Note: You can also run either SQLite3 or Better-SQLite3 with an in-memory database by providing `:memory:` as the filename. For example:"
},
{
type: "code",
language: "js",
content: `
const knex = require('knex')({
client: 'sqlite3', // or 'better-sqlite3'
connection: {
filename: ":memory:"
}
});
`
},
{
type: "info",
content: "Note: When you use the SQLite3 adapter, you can set flags used to open the connection. For example:"
Expand Down
2 changes: 1 addition & 1 deletion sections/prelude.js
Expand Up @@ -4,7 +4,7 @@ export default (version) => [
type: "text",
content: [
`<img height="108" id="logo" src="assets/images/knex.png" alt="Knex.js" />`,
"**Knex.js** (pronounced <a href=\"https://youtu.be/19Av0Lxml-I?t=521\">/kəˈnɛks/</a>) is a \"batteries included\" SQL query builder for **PostgreSQL**, **CockroachDB**, **MSSQL**, **MySQL**, **MariaDB**, **SQLite3**, **Oracle**, and **Amazon Redshift** designed to be flexible, portable, and fun to use. It features both traditional node style [callbacks](#Interfaces-Callbacks) as well as a [promise](#Interfaces-Promises) interface for cleaner async flow control, [a stream interface](#Interfaces-Streams), full-featured [query](#Builder) and [schema](#Schema) builders, [**transaction support (with savepoints)**](#Transactions), connection [pooling](#Installation-pooling) and standardized responses between different query clients and dialects.",
"**Knex.js** (pronounced <a href=\"https://youtu.be/19Av0Lxml-I?t=521\">/kəˈnɛks/</a>) is a \"batteries included\" SQL query builder for **PostgreSQL**, **CockroachDB**, **MSSQL**, **MySQL**, **MariaDB**, **SQLite3**, **Better-SQLite3**, **Oracle**, and **Amazon Redshift** designed to be flexible, portable, and fun to use. It features both traditional node style [callbacks](#Interfaces-Callbacks) as well as a [promise](#Interfaces-Promises) interface for cleaner async flow control, [a stream interface](#Interfaces-Streams), full-featured [query](#Builder) and [schema](#Schema) builders, [**transaction support (with savepoints)**](#Transactions), connection [pooling](#Installation-pooling) and standardized responses between different query clients and dialects.",
"The project is [hosted on GitHub](https://github.com/knex/knex), and has a comprehensive [test suite](https://github.com/knex/knex/actions).",
"Knex is available for use under the [MIT software license](https://github.com/knex/knex/blob/master/LICENSE).",
"You can report bugs and discuss features on the [GitHub issues page](https://github.com/knex/knex/issues), add pages to the [wiki](https://github.com/knex/knex/wiki) or send tweets to [@kibertoad](https://twitter.com/kibertoad).",
Expand Down