-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add the Knex.js instrumentation package as a dependency. - Load it by default. - Add an integration test app for Knex.js. Part of #762
- Loading branch information
Showing
23 changed files
with
4,799 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: "patch" | ||
type: "add" | ||
--- | ||
|
||
Add Knex.js instrumentation. We will now auto instrument database queries made with Knex.js. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM node:16 | ||
|
||
COPY run.sh / | ||
|
||
ENTRYPOINT ["sh", "/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Update with your config settings. | ||
|
||
/** | ||
* @type { Object.<string, import("knex").Knex.Config> } | ||
*/ | ||
module.exports = { | ||
development: { | ||
client: "postgresql", | ||
connection: process.env.DATABASE_URL, | ||
pool: { | ||
min: 2, | ||
max: 10 | ||
}, | ||
migrations: { | ||
tableName: "knex_migrations" | ||
} | ||
}, | ||
|
||
production: { | ||
client: "postgresql", | ||
connection: process.env.DATABASE_URL, | ||
pool: { | ||
min: 2, | ||
max: 10 | ||
}, | ||
migrations: { | ||
tableName: "knex_migrations" | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
test/express-knex/app/migrations/20221121143401_create_posts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = function (knex) { | ||
return knex.schema.createTable("posts", function (table) { | ||
table.increments("id") | ||
table.string("title", 255).notNullable() | ||
table.string("body", 255).notNullable() | ||
}) | ||
} | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.dropTable("posts") | ||
} |
Oops, something went wrong.