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

How get the list of fields + types on a query? #1794

Closed
mamcx opened this Issue Jul 22, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@mamcx

mamcx commented Jul 22, 2018

I'm building a small ORM-like library and wish to use diesel to handle the low-level stuff. All need to be using only raw sql, but I need to know in query, which names + types is returning:

SELECT *, 1, now(), 'hello' as world

so I can map dynamically. Is this possible with diesel? All the info assume is using the custom DSL, not much in how use sql directly (like https://github.com/StackExchange/Dapper?)

@sgrif

This comment has been minimized.

Member

sgrif commented Jul 25, 2018

We don't expose anything that parses your SQL queries for you. You'll likely need to use something much lower level (e.g. libpq or libmysqlclient) which exposes specific details about its prepared statements

@sgrif sgrif closed this Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment