Comments (8)
Thanks. I'll test the change tomorrow and let you know if everything appears to be working.
from marmot.
Thanks for reporting this, and I believe you might be right this might be combination of driver, and what gets serialized back. While I dig deeper to reproduce it, what was surprising to me is if the date time is being stored as a string. Can you kindly tell me what Python library + ORM are you using. As far as data loss, I won't label it as you have lost your data because these timestamps are sitting as UNIX timestamps. Nevertheless it's a quick Google told me:
SQLite does not have an official datetime type. Instead, it stores dates and times as TEXT, REAL or INTEGER values using Date and Time Functions. TEXT as ISO8601 strings (“YYYY-MM-DD HH:MM:SS. SSS”).
https://tableplus.com/blog/2018/07/sqlite-how-to-use-datetime-value.html#:~:text=SQLite%20does%20not%20have%20an,SSS%E2%80%9D).
Now question for me is to see if I can detect if it's string or integer or real. With how driver is converting it under the hood, it might be challenging.
from marmot.
You're correct that the data is not lost - just unexpectedly transformed, which caused quite a bit of troubleshooting on my end.
With that said, I'm using python's standard sqlite3 library. I'm inserting into the sql datetime fields via the datetime class's __str__()
method, which returns an ISO8601 formatted string.
IE:
In [1]: from datetime import datetime, timezone
In [2]: dt = datetime.now(tz=timezone.utc)
In [3]: dt
Out[3]: datetime.datetime(2023, 8, 16, 20, 23, 18, 105371, tzinfo=datetime.timezone.utc)
In [4]: str(dt)
Out[4]: '2023-08-16 20:23:18.105371+00:00' # <-- this is what I'm inserting to sqlite3 db as a param
from marmot.
Just to update, I am able to reproduce the issue. The code in Marmot is pretty straight forward and I am trying to see if I can monkey patch something to unblock you. So far dead-ends I will post once I land something.
from marmot.
Update 2: I've Identified the issue, will be working over it to get the fix out. Next version should have the fix in it.
from marmot.
@Blackmoomba I will release a beta version in a while, I've verified on my end that it works. Can you help me test that it works for you as well?
Here is before (first insert and select) and after (second insert after fix) that I am seeing:
from marmot.
This fixed the issue. Thanks very much for resolving this so quickly.
from marmot.
Prefect I will wait for a few days for you to double check and close the ticket.
from marmot.
Related Issues (20)
- Download button with correct version for site HOT 1
- Keystone alternative
- How to get first snapshot to work HOT 31
- Sqlite Database is Locked is Coming, and Marmot is Crashing After Continusouly Inserting For Long time. HOT 12
- Need explanation: How does it handle conflicts? How does it merge data? HOT 2
- Perf - 138.3 writes/sec is really slow.... HOT 4
- benthos and marmot seems like a bit of a good marriage HOT 2
- Unable to scan global changes error no such table __marmot___change_log_global HOT 6
- sql: Scan error on column index 4, name \"pk\": sql/driver: couldn't convert 2 into type bool HOT 11
- polling doesnt start until a change is detected HOT 3
- Build for mac OSX HOT 6
- Add a simple example. Can be a Marmot admin gui later
- What is the best way to handle schema migrations? HOT 3
- Support for 2 nodes only? HOT 4
- NATS TLS authentication HOT 1
- Consider cgo-free version of sqlite HOT 2
- Crash: "double free or corruption (!prev)" HOT 2
- Use Nats-Expected-Last-Sequence etc. to manage competing updates more deterministically
- Example FAILING to CONNECT ! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marmot.