Add Database functionality #4

Closed
xc22zhan wants to merge 14 commits from Alex into master
xc22zhan commented 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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

database component exports a sqlite database with the openDb async function.
w388zhan commented 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

forgot to remove?

forgot to remove?
w388zhan commented 2 years ago (Migrated from git.uwaterloo.ca)
Owner

what changed in this file?

what changed in this file?
w388zhan commented 2 years ago (Migrated from git.uwaterloo.ca)
Owner

maybe make this a dev dependency?

maybe make this a dev dependency?
w388zhan commented 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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

what's `flag` for? it seems to be always true
w388zhan commented 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

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 2 years ago (Migrated from git.uwaterloo.ca)
Owner

nit: I prefer openDB since it's an acronym

nit: I prefer `openDB` since it's an acronym
w388zhan commented 2 years ago (Migrated from git.uwaterloo.ca)
Owner

forgot to resolve conflict?

forgot to resolve conflict?
This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: old/discord-bot#4
Loading…
There is no content yet.