-
Notifications
You must be signed in to change notification settings - Fork 1
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
add diesel and users table #19
Conversation
7229543
to
28f690f
Compare
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.
Commented on a few things I am unsure of, let me know in the comments whether changes are necessary and we can get this merged 😄
src/db/messages/mod.rs
Outdated
@@ -0,0 +1,11 @@ | |||
use crate::db::models; | |||
use actix_web::actix::*; |
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.
Do we need actix 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.
We do. actix
imports the prelude which has the Message
trait. We need actix_web
for the actix_web::Error
type.
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.
Hmmm, rather than use
-ing the whole prelude of both, should we instead just use actix::Message
and actix_web::Error
? (super nit-picky for this stage in the development)
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.
Ok, I made it more explicit. I also updated a few other places I was importing actix
or actix_web
wildcards.
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.
LGTM 👍
This PR adds diesel ORM for interacting with sqlite database. It sets us up to interact with the database actor to query and command our data.
There is a directory structure that should help separate important concerns:
Handlers are functions that process messages. Messages are the messages important to the db actor. Models represent the data.
We can use sqlite for now during early development. This allows us to move a little faster.
This PR addresses some of the concerns in #16