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

allow 'impl Into<BoltType> for "CustomType"' #7

Closed
vr-devil opened this issue Mar 21, 2021 · 2 comments
Closed

allow 'impl Into<BoltType> for "CustomType"' #7

vr-devil opened this issue Mar 21, 2021 · 2 comments

Comments

@vr-devil
Copy link

vr-devil commented Mar 21, 2021

i want bind json object by Query.param(). but Into<BoltType> just implemented for some basic type.

can bind whole properties for label by Query.param()? like this:

struct CustomType<T:  Into<BoltType>> {
  p1: T,
  p2: T,
  p3: T,
}

let properties = CustomType::new();

// case 1
query("CREATE (SomeLabel $properties)").param("properties", properties);

// case 2
query("CREATE (SomeLabel {data: $data})").param("data", properties);
@kkharji
Copy link

kkharji commented Mar 18, 2022

How did you get BoltType, I'm trying to create a custom function for a type to "find_by_key" and I need to use BoltType to make it generic.

@knutwalker
Copy link
Collaborator

0.7.0-rc.2 now pub exports the BoltType(s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants