Pass timestamp with milliseconds to SQLAlchemy backed by SQLite3

10 views
Skip to first unread message

Konrad Reiche

unread,
Jul 24, 2019, 7:32:20 PM7/24/19
to sqlalchemy

Hello everyone,

It seems SQLAlchemy doesn't translate filter with a timestamp having fractional seconds properly to SQLite3:

.filter(User.created_at <= 1564004268.302929)

But from what I've observed via debugging, only the seconds are passed to SQLite3 via SQLAlchemy. What's the correct way of performing this query?

Best,
Konrad

Mike Bayer

unread,
Jul 25, 2019, 9:19:49 PM7/25/19
to noreply-spamdigest via sqlalchemy
Hi there -

We would need some context for this. 

What does CREATE TABLE look like? What is the datatype in use?  What does the logging output say, e.g. illustrate the SQL and result output with create_engine(..., echo='debug').     It looks like you are using some epochal oriented datatype but no such datatype is included with SQLAlchemy.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
 
 
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages