-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
🔨 migrate charts from typeorm to knex #3293
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
a017102
to
3b3f0eb
Compare
238800a
to
2e741fe
Compare
.vscode/launch.json
Outdated
@@ -104,6 +104,7 @@ | |||
"program": "${workspaceFolder}/itsJustJavascript/adminSiteServer/app.js", | |||
"request": "launch", | |||
"type": "node", | |||
"runtimeExecutable": "/mnt/wslg/runtime-dir/fnm_multishells/5693_1709636182174/bin/node" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this should go here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(partial review only, I didn't look at the heavy hitters yet)
@@ -156,6 +156,12 @@ export const knexRawFirst = async <TRow = unknown>( | |||
return results[0] | |||
} | |||
|
|||
export const knexRawInsert = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rather enforce a KnexReadWriteTransaction
to be safe?
(Likewise for the above knexRawFirst
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good idea, in this case we can.
I'll make knexRawFirst take a RO transaction as this function is really for reading a single item I'd say
db/tests/basic.test.ts
Outdated
await trx | ||
.table(ChartsTableName) | ||
.where({ id: 1 }) | ||
.update({ isExplorable: 0 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, sophia is removing this one in #3323 currently, maybe use a different column :)
@@ -17,7 +17,7 @@ const computeScore = (record: Omit<ChartRecord, "score">): number => { | |||
const getChartsRecords = async ( | |||
knex: db.KnexReadonlyTransaction | |||
): Promise<ChartRecord[]> => { | |||
const chartsToIndex = await db.queryMysql(` | |||
const chartsToIndex = await db.queryMysql(`-- sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one you can easily convert to trx-style.
6e9d27d
to
5ef0579
Compare
2e741fe
to
89e40d9
Compare
9614859
to
bf9c363
Compare
3691f92
to
34d125e
Compare
bf9c363
to
685334e
Compare
34d125e
to
5932a9e
Compare
685334e
to
8b9d87a
Compare
5932a9e
to
d12fa27
Compare
8b9d87a
to
6a60379
Compare
d12fa27
to
13fda36
Compare
6a60379
to
b1db3a1
Compare
13fda36
to
e9db6b4
Compare
b1db3a1
to
338caee
Compare
e9db6b4
to
710c3d5
Compare
Migrates database access to the charts table and the chart_revisions table to knex