Skip to content

node: add knex example to sample#27

Merged
balachandr merged 3 commits intogoogle:masterfrom
aabmass:sample-knex-express
Jan 12, 2021
Merged

node: add knex example to sample#27
balachandr merged 3 commits intogoogle:masterfrom
aabmass:sample-knex-express

Conversation

@aabmass
Copy link
Member

@aabmass aabmass commented Nov 11, 2020

Depends on #26.

This adds a server using knex that does the same thing as the sequelize one. Because of #25, this won't work with node versions older than 14.5.0.

Also, updated package.json to install dependencies from tarball, which is works like installing from npm registry directly.

@aabmass aabmass force-pushed the sample-knex-express branch from 62a8493 to 15b8a07 Compare November 11, 2020 17:11
@aabmass aabmass changed the title sample knex express node: add knex examlpe to sample Nov 11, 2020
@aabmass aabmass changed the title node: add knex examlpe to sample node: add knex example to sample Nov 11, 2020
@aabmass aabmass force-pushed the sample-knex-express branch from 15b8a07 to 335b29a Compare November 11, 2020 19:00
@aabmass aabmass marked this pull request as ready for review November 11, 2020 19:01
Copy link
Member Author

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to update the README still

@aabmass aabmass force-pushed the sample-knex-express branch from 335b29a to b96421e Compare November 11, 2020 19:07
@aabmass
Copy link
Member Author

aabmass commented Nov 11, 2020

Ready for review :)

@aabmass aabmass force-pushed the sample-knex-express branch from b96421e to 8bbe52d Compare November 11, 2020 19:08
Copy link
Contributor

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @aabmass! LGTM, but one suggestion about explicitly giving disclosure to users lest they'll copy and paste examples and have a high cardinality burst then be surprised.

Comment on lines 7 to 9
client_timezone: true,
db_driver: true,
route: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This are supposed to be optional, let's add a disclaimer here that adding these fields isn't mandatory and will cause a high cardinality burst. Actually I'd start with firstly putting the most important fields traceparent and tracestate then these 3 below them after a newline, and with the comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will do. The actual code defaults should probably be updated, too:

const defaultFields = {
'route': true,
'tracestate': false,
'traceparent': false,
};

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know how it looks now

@aabmass
Copy link
Member Author

aabmass commented Nov 11, 2020

I have orijtech/sqlcommenter-website#72 open, which updates the documentation to link to these examples

@balachandr balachandr self-requested a review January 11, 2021 21:04
@aabmass
Copy link
Member Author

aabmass commented Jan 11, 2021

@balachandr fixed the conflicts

@balachandr
Copy link
Contributor

👍

@balachandr balachandr merged commit 0d1c453 into google:master Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants