rockdai / sql-bricks

Transparent, Schemaless SQL Generation
http://csnw.github.io/sql-bricks
MIT License
213 stars 25 forks source link

Data Type Casting? #44

Closed rickbergfalk closed 10 years ago

rickbergfalk commented 10 years ago

Is there currently a way to hint at a data type when building a SQL string?

I'm trying to build an insert/update SQL statement for Postgres with a BIT datatype column. When I build the statement with sql-bricks insert("table_with_bit_column", {"bit_column": 1}); ... it errors out complaining that the int datatype is not compatible with a bit datatype.

I know I can do 1::BIT when handwriting the SQL, but I'm not sure how to do this in sql-bricks.

Is this something that is supported with sql-bricks?

No worries if it isn't, just curious :)

rickbergfalk commented 10 years ago

WAIT A SECOND. Well I feel stupid now. I just realized a string is accepted as a BIT.

This question can be ignored.