kayak / pypika

PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.
http://pypika.readthedocs.io/en/latest/
Apache License 2.0
2.43k stars 293 forks source link

Using python object ipaddress.IPv4Address leads to incorrect SQL. #727

Open maksim-nik opened 1 year ago

maksim-nik commented 1 year ago
In [8]: import pypika

In [9]: pypika.__version__
Out[9]: '0.48.9'

In [10]: from ipaddress import IPv4Address

In [11]: print(pypika.PostgreSQLQuery.into(pypika.Table("test_table")).columns('ip').insert(IPv4Address('123.123.123.123')))
INSERT INTO "test_table" ("ip") VALUES (123.123.123.123)

Expected result:

INSERT INTO "test_table" ("ip") VALUES ('123.123.123.123')