Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Unable to generate parameters &[&ToSql] dynamicaly. Please help! #71

Open
andriy-viyatyk opened this issue Aug 9, 2018 · 2 comments
Open

Comments

@andriy-viyatyk
Copy link
Contributor

Hello.

I am trying to write some object model for my project and stuck on errors like "temporary/borrowed value does not live long enough" in attempts to generate parameters &[&ToSql]. The only way I found is to implement ToSql trait for my own types, but for that I need to make ToColumnData and ColumnData public.

Rust.zip
Here is an archive with simple example of object model. The "obj_model_test" inside works, but contains commented String field and related code. If remove the comments compilation will fail. Similar problem I have with Uuid fields (uuid crate) and some custom field that serializes to binary.

Do you know some way to create parameters not just from local variables ?

Thanks in advance for any help.

@CJPrindle
Copy link

I'm not sure to be honest. Do parameters need to be included in the use statement for tiberius, maybe? Hopefully, someone who actually knows something will help you. Good Luck!

@nevi-me
Copy link

nevi-me commented Mar 28, 2019

Looks like I'm also hitting this problem, in my case I'm trying to convert Vec<String> to &[&ToSql] when trying to create an select * from x where x.a in (...)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants