-
Notifications
You must be signed in to change notification settings - Fork 258
Core redesign v2 #46
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
Core redesign v2 #46
Conversation
POC flip creates.
Moved parser into query doc. Removed next wave of previous hacks.
Nested updates require fairly major changes.
Cleanup.
Implement Get expression & evaluation.
Fix inconsistent code formatting.
…to core_redesign_v2
(Always swap top down)
Next: Cleanup.
@@ -114,6 +114,10 @@ pub enum ConnectorError { | |||
|
|||
#[fail(display = "Authentication failed for user '{}'", user)] | |||
AuthenticationFailed { user: String }, | |||
|
|||
// Todo: Temporary! |
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.
👀
|
||
fn delete_records(&mut self, model: ModelRef, where_: Filter) -> crate::Result<usize>; | ||
|
||
// We plan to remove the methods below in the future. We want emulate them with the ones above. Those should suffice. |
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.
Removing them before or after merge?
use connector_interface::*; | ||
use std::marker::PhantomData; | ||
|
||
pub struct SqlConnectorTransaction<'a, T> { |
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 probably can get rid of this when we asyncify the code.
mod builder; | ||
mod delete_actions; | ||
mod nested_actions; | ||
use crate::error::SqlError; |
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.
In the whole file, is there a different indentation than in the other files? Looks like 2 spaces instead of 4...
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.
At least in some of the lines...
Some(result) | ||
} | ||
|
||
// pub fn update_one(model: ModelRef, id: &GraphqlId, args: &PrismaArgs) -> crate::Result<Option<Update<'static>>> { |
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.
👀
} | ||
} | ||
|
||
pub fn with_interpreter<'a, F>(&self, f: F) -> ConnectorResult<Response> |
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.
This might be nasty with async/await. Luckily we might not need this kind of arch soon... See https://github.com/prisma/prisma-engine/blob/bench/query-engine/connectors/sql-query-connector/src/transactional/mod.rs#L21
So instead of with_transaction {}
we can just get a connection and start a transaction!
} | ||
} | ||
|
||
// impl From<InterpreterError> for ConnectorError { |
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.
👀
.collect() | ||
} | ||
|
||
// fn run_node_transformers(transformers: Vec<(String, ParentIdsFn)>) { |
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.
👀
use super::*; | ||
use std::fmt::{self, Display}; |
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.
See if everything here can implement Display
.
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.
Using the Formatter
is a better idea than allocating a new String
every time.
} | ||
|
||
/// Only allow multiple parent edges if all parents are ancestors of each other. | ||
fn only_allow_related_parents_edges(_graph: &QueryGraph) -> QueryGraphResult<()> { |
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.
👀
} | ||
} | ||
|
||
// impl fmt::Display for QueryValidationError { |
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.
👀
Update to tokio 0.2 and futures 0.3
Wip