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

Any driver does not support the Postgres type PgTypeInfo(Varchar) #2975

Closed
holicc opened this issue Jan 9, 2024 · 2 comments
Closed

Any driver does not support the Postgres type PgTypeInfo(Varchar) #2975

holicc opened this issue Jan 9, 2024 · 2 comments
Labels

Comments

@holicc
Copy link
Contributor

holicc commented Jan 9, 2024

Bug Description

using AnyPool to fetch_all

Minimal Reproduction

 #[tokio::test]
    async fn test_any_row() -> Result<()> {
        // sqlx init drivers
        sqlx::any::install_default_drivers();
        let pg_options =
            "postgres://....".parse::<AnyConnectOptions>()?;
        let pool: Pool<Any> = PoolOptions::new().connect_lazy_with(pg_options);
        // set up the database connection pool
        // error 
        let r = pool
            .fetch_all("SELECT age, name FROM users")
            .await?;

        println!("========> {}",r.len());

        for a in r {
            let c: String = a.get("name");
            println!("========> {}", c);
        }

        Ok(())
    }

Info

  • SQLx version: 0.7.0
  • SQLx features enabled: "postgres","runtime-tokio-native-tls", "json", "chrono", "bigdecimal",
  • Database server and version: PG 14.9
  • Operating system: Mac M1
  • rustc --version: rustc 1.75.0
@pixelspark
Copy link

@holicc I ran into the same issue today, hopefully your PR gets merged soon!

A suggestion, please have a look at the full list of PgTypes and add some other. I.e. Name (a type returned from queries to information_schema) and Char probably should also be interpreted as text/string.

@abonander
Copy link
Collaborator

Closed by #2976.

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

No branches or pull requests

3 participants