It does distinguish between types, as has been pointed out in this thread.
I recreated the example from the video in SQLite:
https://gist.github.com/mattseh/185ea1c1da19132ac860
Here is the output:
https://gist.github.com/mattseh/a1f66394d842cb39cceb
That example was from SQLite. This is because SQLite doesn't have a dedicated date or datetime type, instead relying on base types, in this example, a string (reference: Datatypes In SQLite Version 3)
I tried a similar query on an app I'm working on, where pony is using Postgres, which is a lot more full featured.
It's almost like the ORM is generating database specific queries. Crazy, huh?
Edit: I looked into MySQL, and found this:
https://github.com/ponyorm/pony/blob/orm/pony/orm/dbproviders/mysql.py#L39
Anonymous quote from someone on skype: "kiopa seems stubbornly opposed to doing anything that might be convienent"
I recreated the example from the video in SQLite:
https://gist.github.com/mattseh/185ea1c1da19132ac860
Here is the output:
https://gist.github.com/mattseh/a1f66394d842cb39cceb
That example was from SQLite. This is because SQLite doesn't have a dedicated date or datetime type, instead relying on base types, in this example, a string (reference: Datatypes In SQLite Version 3)
I tried a similar query on an app I'm working on, where pony is using Postgres, which is a lot more full featured.
Code:
In [11]: models.select(k for k in models.Keyword if k.last_google_search.year == 2013)[:]
SELECT "k"."id", "k"."site", "k"."keyword", "k"."last_search"
FROM "keyword" "k"
WHERE EXTRACT(YEAR FROM "k"."last_search") = 2013
Edit: I looked into MySQL, and found this:
https://github.com/ponyorm/pony/blob/orm/pony/orm/dbproviders/mysql.py#L39
Anonymous quote from someone on skype: "kiopa seems stubbornly opposed to doing anything that might be convienent"