Add Database functionality #4

Closed
xc22zhan wants to merge 14 commits from Alex into master
xc22zhan commented 2021-05-23 20:23:39 -04:00 (Migrated from git.uwaterloo.ca)

database component exports a sqlite database with the openDb async function.

database component exports a sqlite database with the openDb async function.
w388zhan commented 2021-05-23 20:29:51 -04:00 (Migrated from git.uwaterloo.ca)

I think we should keep this file to automatically set up formatting on save within VS Code

I think we should keep this file to automatically set up formatting on save within VS Code
w388zhan commented 2021-05-23 20:30:34 -04:00 (Migrated from git.uwaterloo.ca)

forgot to remove?

forgot to remove?
w388zhan commented 2021-05-23 20:31:19 -04:00 (Migrated from git.uwaterloo.ca)

what changed in this file?

what changed in this file?
w388zhan commented 2021-05-23 20:32:38 -04:00 (Migrated from git.uwaterloo.ca)

maybe make this a dev dependency?

maybe make this a dev dependency?
w388zhan commented 2021-05-23 20:37:23 -04:00 (Migrated from git.uwaterloo.ca)

Maybe move the implementation of these commands to a separate file so it'll be easier to remove these commands later. I don't like having test commands in the actual bot, maybe wrap them in a if (process.env.NODE_ENV == "dev") to be safe. In the future we will be writing integration tests for this.

Maybe move the implementation of these commands to a separate file so it'll be easier to remove these commands later. I don't like having test commands in the actual bot, maybe wrap them in a `if (process.env.NODE_ENV == "dev")` to be safe. In the future we will be writing integration tests for this.
w388zhan commented 2021-05-23 20:40:21 -04:00 (Migrated from git.uwaterloo.ca)

what's flag for? it seems to be always true

what's `flag` for? it seems to be always true
w388zhan commented 2021-05-23 20:51:09 -04:00 (Migrated from git.uwaterloo.ca)

if you are using await, then you can do something like

const db = await openDB()
db.run('...')

One of the reasons to use async/await is to avoid a bunch of .thens

if you are using await, then you can do something like ``` const db = await openDB() db.run('...') ``` One of the reasons to use async/await is to avoid a bunch of `.then`s
xc22zhan commented 2021-05-23 21:18:50 -04:00 (Migrated from git.uwaterloo.ca)

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56136&start_sha=cd92da309fff2a333752d564af1bba4092ee5668#7030d0b2f71b999ff89a343de08c414af32fc93a_16_16)
xc22zhan commented 2021-05-23 21:18:50 -04:00 (Migrated from git.uwaterloo.ca)

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56136&start_sha=cd92da309fff2a333752d564af1bba4092ee5668#a123abce010ea7d96fa76c6a9040950b5dac59bc_50_48)
xc22zhan commented 2021-05-23 21:18:51 -04:00 (Migrated from git.uwaterloo.ca)

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56136&start_sha=cd92da309fff2a333752d564af1bba4092ee5668#a123abce010ea7d96fa76c6a9040950b5dac59bc_62_48)
xc22zhan commented 2021-05-23 21:18:51 -04:00 (Migrated from git.uwaterloo.ca)

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56136&start_sha=cd92da309fff2a333752d564af1bba4092ee5668#a123abce010ea7d96fa76c6a9040950b5dac59bc_55_48)
xc22zhan commented 2021-05-23 21:18:51 -04:00 (Migrated from git.uwaterloo.ca)

added 1 commit

  • 65751723 - merge fixes and add gitattributes

Compare with previous version

added 1 commit <ul><li>65751723 - merge fixes and add gitattributes</li></ul> [Compare with previous version](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56136&start_sha=cd92da309fff2a333752d564af1bba4092ee5668)
xc22zhan commented 2021-05-23 21:25:14 -04:00 (Migrated from git.uwaterloo.ca)

added 2 commits

Compare with previous version

added 2 commits <ul><li>35c3e23f - fix line endings</li><li>3634c513 - fix line changes</li></ul> [Compare with previous version](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56140&start_sha=65751723765451c510981dc36c6b3a1a048615e5)
xc22zhan commented 2021-05-23 21:33:21 -04:00 (Migrated from git.uwaterloo.ca)

added 1 commit

Compare with previous version

added 1 commit <ul><li>543689e4 - change line endings to crlf</li></ul> [Compare with previous version](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56142&start_sha=3634c513953db6606bd818a97e84d12509831e5b)
w388zhan commented 2021-05-23 21:37:07 -04:00 (Migrated from git.uwaterloo.ca)

we probably want to gitignore the entire /db dir just to be safe

we probably want to gitignore the entire `/db` dir just to be safe
xc22zhan commented 2021-05-23 21:38:02 -04:00 (Migrated from git.uwaterloo.ca)

added 2 commits

Compare with previous version

added 2 commits <ul><li>278cd99c - update gitattributes</li><li>9e55e540 - update gitattributes</li></ul> [Compare with previous version](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56146&start_sha=543689e4ff503897e2e276ee4b29f8ee791c123a)
xc22zhan commented 2021-05-23 21:46:13 -04:00 (Migrated from git.uwaterloo.ca)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56148&start_sha=9e55e5407c2094f372a6f031e2458217778797b0#a5cc2925ca8258af241be7e5b0381edf30266302_5_5)
xc22zhan commented 2021-05-23 21:46:13 -04:00 (Migrated from git.uwaterloo.ca)

added 1 commit

Compare with previous version

added 1 commit <ul><li>5acdd116 - update gitignore</li></ul> [Compare with previous version](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56148&start_sha=9e55e5407c2094f372a6f031e2458217778797b0)
xc22zhan commented 2021-05-23 21:49:57 -04:00 (Migrated from git.uwaterloo.ca)

added 1 commit

Compare with previous version

added 1 commit <ul><li>f0214b58 - restore vscode settings</li></ul> [Compare with previous version](/csc/discord-bot/-/merge_requests/4/diffs?diff_id=56150&start_sha=5acdd1161516f91c60fe3a5e84ffef1a3626ee9a)
w388zhan commented 2021-05-23 21:51:11 -04:00 (Migrated from git.uwaterloo.ca)

maybe we want this outside of the switch statement, since there's one inside testDb

maybe we want this outside of the switch statement, since there's one inside `testDb`
w388zhan commented 2021-05-23 21:51:58 -04:00 (Migrated from git.uwaterloo.ca)

nit: I prefer openDB since it's an acronym

nit: I prefer `openDB` since it's an acronym
w388zhan commented 2021-05-23 21:58:59 -04:00 (Migrated from git.uwaterloo.ca)

forgot to resolve conflict?

forgot to resolve conflict?

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: old/discord-bot#4
No description provided.