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

FromSql trait is private #35

Closed
Cheburum opened this issue Apr 26, 2019 · 1 comment
Closed

FromSql trait is private #35

Cheburum opened this issue Apr 26, 2019 · 1 comment

Comments

@Cheburum
Copy link

To my mind it is better to have public FromSql trait. Sometimes there is a need to write generics like this:


fn get_db_column<T>(column_name: &str, query: &str) -> Vec<T>
where T: Send + FromSql
{
        let mut runtime = tokio::runtime::Runtime::new()
                                   .expect("Unable to create a runtime");
        let pool = Pool::new(get_clickhouse_addr());

        let done = pool
            .get_handle()
            .and_then(move |c| c.query(query).fetch_all())
            .and_then(move |(_, block)| {
                let mut column_vec = vec!();

                for row in block.rows() {
                    let item: T = row.get(column_name)
                ...
suharev7 added a commit that referenced this issue May 2, 2019
@suharev7
Copy link
Owner

suharev7 commented May 2, 2019

Thanks for the advice it's quite reasonable. Here is a commit to implementing this and I will publish it with the next version.

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

No branches or pull requests

2 participants