-
Notifications
You must be signed in to change notification settings - Fork 240
SQL statements represented in PonyORM
Luckydonald edited this page Dec 8, 2016
·
10 revisions
This pages lists some commonly used SQL stuff, and how that would work with pony. Feel free to improve this list yourself!
delete(o for o in Order if o.status == 'CANCELLED')
user = User.get(id=1234)
user.delete()
Or with an instance:
user = User.get(id=1234) User.delete(user)
[Postgres Docs](https://www.postgresql.org/docs/8.3/static/sql-delete.html)
### `LIMIT 50`
```python
.limit(50)
.limit(50, offset=100)
class Example(db.Entity):
a = Required(str)
b = Optional(int)
composite_key(a, b)
select(
t in Tag if t.column.lower() == "TestText".lower()
)