shssoichiro / iron-valid

Laravel-inspired validator for iron/iron-params
MIT License
11 stars 3 forks source link

Add compatibility with diesel #29

Open shssoichiro opened 8 years ago

shssoichiro commented 8 years ago

The database validators should be able to support a variety of interfaces, including diesel orm.

ernestas-poskus commented 7 years ago

@shssoichiro do you plan to add support for this ?

shssoichiro commented 7 years ago

I would like to but haven't found an approach that works yet. Assistance would be welcome, as well.

ernestas-poskus commented 7 years ago

I would like to but haven't found an approach that works yet.

I assume we could follow similar approach to postgres feature just querying logic would be different

shssoichiro commented 7 years ago

The issue is that diesel doesn't have support for running raw SQL queries with bound parameters. This means needing to allow passing in generic params that implement Diesel's traits for Tables and Columns. Last time I tried this I wasn't very good at dealing with generics in Rust, so maybe I should take another attempt at it.

ernestas-poskus commented 7 years ago

I am doing more stuff with diesel nowadays so I can help somehow

shssoichiro commented 7 years ago

It appears that diesel has added support for raw SQL and binds in a recent version, making this feature much easier to implement: http://docs.diesel.rs/diesel/expression/dsl/fn.sql.html