Skip to content

Insert with parameters #166

Closed
Closed
@nevinpuri

Description

@nevinpuri

Use case
I want to insert data into a chdb instance by using the query function, or similar.

var = "hi"
client = Session()
client.query("CREATE TABLE test_table (id UUID, val String) Engine = MergeTree;")
client.query("INSERT INTO test_table VALUES (?)", var);

Is this possible? I'm aware I can just format my values to strings and concatenate them with the query. However, that's prone to sql injection attacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions