Skip to content
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

Merged
merged 7 commits into from
Dec 10, 2018
Merged

add diesel and users table #19

merged 7 commits into from
Dec 10, 2018

Conversation

xmclark
Copy link
Contributor

@xmclark xmclark commented Dec 9, 2018

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:

db
|-- handlers
|-- messages
|-- models

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

@xmclark xmclark force-pushed the maintenance/16-add-diesel branch from 7229543 to 28f690f Compare December 9, 2018 20:45
Copy link
Contributor

@damon-myers damon-myers left a 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 😄

@@ -0,0 +1,11 @@
use crate::db::models;
use actix_web::actix::*;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@damon-myers damon-myers Dec 10, 2018

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)

Copy link
Contributor Author

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.

@xmclark xmclark mentioned this pull request Dec 10, 2018
Copy link
Contributor

@damon-myers damon-myers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@xmclark xmclark merged commit 9bd8da5 into master Dec 10, 2018
@xmclark xmclark deleted the maintenance/16-add-diesel branch December 10, 2018 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants