-
Notifications
You must be signed in to change notification settings - Fork 0
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
Kysely #32
Merged
Merged
Kysely #32
Conversation
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
Tlacenka
previously approved these changes
Feb 8, 2025
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.
Good job, thank you for the extensive documentation and guide on how to run it. 👍
Tlacenka
approved these changes
Feb 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🦾 CI/CD
continuous integration and deployment
🧹 maintenance
project maintenance
🚀 setup
project setup
🛠️ tooling
tooling integration and maintenance
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #21
Features
postgres
Docker image.public.users
Postgres table transformed toUserModel
type).[email protected]
) in non-production environment.db
library for client and models.@th/db
inapi
to resolve "current" user.mappers
to use database models in resolvers.Testing
Running
npm start
will spin up local database (requires Docker Compose) and run migration.Visit http://localhost:8080/?pgsql=db&username=admin&db=th_db&ns=public in browser and sign in with password
admin
:View test user
[email protected]
inusers
table:(Optional) Add new user
Go to
users
table and add new item. You can use SHA256 - Online Tools to hash your password, or just generate a random hash withnode -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
.See user logged by
website
andcms
(as in #27 description), or query GraphQL API directly:If you need to drop local database, run
docker compose down
(loses data!).Next steps
This database setup with
npm-run-all
works, but isn't very compatible Nx cache. I would like to convert thesepackage.json
scripts (starting DB container, migration, seeding) into Nx targets for thedb
library, so that the dependencies are part of the Nx task graph.