prisma / tiberius

TDS 7.2+ (Microsoft SQL Server) driver for Rust
Apache License 2.0
311 stars 113 forks source link

Question: Can only create schema in simple_query #310

Open wyhaya opened 11 months ago

wyhaya commented 11 months ago

The only time I don't get an error is when I use a simple_query.

// Error
let rst = client .execute("CREATE SCHEMA name", &[]) .await;
// Error
let rst = client.query("CREATE SCHEMA name", &[]).await;
// Ok
let rst = client.simple_query("CREATE SCHEMA name").await;

Error message:

[examples/tokio.rs:32] rst = Err(
    Server(
        TokenError {
            code: 156,
            state: 1,
            class: 15,
            message: "Incorrect syntax near the keyword 'SCHEMA'.",
            server: "92b6321b9335",
            procedure: "",
            line: 1,
        },
    ),
)

I am a beginner in SQL Server, and I'm not sure if it's a bug.