Skip to content

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

Merged
merged 122 commits into from
Oct 30, 2019
Merged

Core redesign v2 #46

merged 122 commits into from
Oct 30, 2019

Conversation

dpetrick
Copy link
Contributor

Wip

  • Fundamentally changes query execution model.
  • Changes connector interface to symmetric read and write, as well as an exposed transactional model.
  • Moves a ton of responsibilities, and thus code, into the core.

dpetrick and others added 30 commits August 27, 2019 17:11
Moved parser into query doc.
Removed next wave of previous hacks.
Nested updates require fairly major changes.
Implement Get expression & evaluation.
@dpetrick dpetrick changed the title [WIP] Core redesign v2 Core redesign v2 Oct 29, 2019
@@ -114,6 +114,10 @@ pub enum ConnectorError {

#[fail(display = "Authentication failed for user '{}'", user)]
AuthenticationFailed { user: String },

// Todo: Temporary!
Copy link
Contributor

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.
Copy link
Contributor

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> {
Copy link
Contributor

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;
Copy link
Contributor

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...

Copy link
Contributor

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>>> {
Copy link
Contributor

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>
Copy link
Contributor

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 {
Copy link
Contributor

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)>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Comment on lines +1 to +2
use super::*;
use std::fmt::{self, Display};
Copy link
Contributor

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.

Copy link
Contributor

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<()> {
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

@dpetrick dpetrick merged commit ad52689 into master Oct 30, 2019
@dpetrick dpetrick deleted the core_redesign_v2 branch October 30, 2019 09:31
miguelff pushed a commit that referenced this pull request Apr 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update to tokio 0.2 and futures 0.3
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.

None yet

4 participants