pypika icon indicating copy to clipboard operation
pypika copied to clipboard

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 us...

Results 190 pypika issues
Sort by recently updated
recently updated
newest added

I have the following PyPika code: ```python from pypika import MySQLQuery, Parameter, Table table1 = Table("Table_1") table2 = Table("Table_2") table3 = Table("Table_3") print( MySQLQuery.from_(table1) .delete() .inner_join(table2) .on(table2.id.eq(table1.table2_id)) .inner_join(table3) .on(table3.id.eq(table2.table3_id)) .where(table3.id.eq(Parameter("%s")))...

Want to realize ```left join "bill".get_account_funds("a"."unique_id") balance on true``` using pypika. Database is PostgreSQL. The whole query works, but no idea to make it in pypika

Added a nice and useful syntactic sugar for select, allowing to define field alias by employing kwars parameter names i.e. instead of - select(table.foo.as_("bar")) you can write - select(bar=table.foo) the...

today when aliasing columns in select clauses it is written more or less like this - `select(table.foo.as_("bar"))` it would be really nice if instead, we could leverage kwargs to write...

I would like to search for a value in an array column (`str[]`). I am using PostgresSQL and the SQL format for such a query condition is `WHERE 'value' =...

Is there a way to express a query as such? `((arr1[(CARDINALITY(arr1) / 2) + 1] + arr1[(CARDINALITY(arr1) / 2)]) / 2.0) FROM (SELECT ARRAY_SORT(FILTER(ARRAY[4,6,2,8],x -> x IS NOT NULL)) "arr1")`...

This PR should address https://github.com/kayak/pypika/issues/579 by formatting `UPDATE` queries using the same rules as `INSERT` queries. Regression tests for the new case have been added, courtesy of @vfonte91. A side...

Hello! When using the Postgres dialect, a `list` isn't being converted to an `ARRAY` for `UPDATE` statements. Lists are handled correctly for `INSERT` statements and there's test coverage. To replicate:...

In readme of updating data shows The syntax for joining tables is the same as when selecting data ``` customers, profiles = Tables('customers', 'profiles') Query.update(customers) .join(profiles).on(profiles.customer_id == customers.id) .set(customers.lname, profiles.lname)...