Comments (5)
IMO this should be done at a higher level But I'd be interested to see the argument for including in this package. Do other low-level MySQL libraries do this?
from mysql-nio.
This library handles time zone.
This approach is like option 1 in the other issue and we encounter the QueryBuilder.filter
problem.
from mysql-nio.
I'd be interested to know how libmysql
is getting the timezone information (that's what the library you linked is using).
MySQL gives back a MYSQL_TIME
struct which is formatted as shown above. As you can see, no timezone information is supplied as a part of that struct. Perhaps it's sent somewhere else in the binary return data or there is some sort of flag to opt-in to retrieving it?
from mysql-nio.
Ah, after looking into this more I see that MySQL is not capable of storing time zones alongside the data (PostgreSQL is, which is what confused me). The server has a global time zone and that is it.
I also looked into novi/mysql-swift more and it seems like they are not actually fetching the MySQL Server's time zone. You set the time zone when you create a connection, and all Date
's created thereafter will use that timezone.
I think to add proper timezone support in this package, MySQLConnection
should gain a new property timeZone: TimeZone?
and a new method determineTimeZone() -> Future<Void>
. This method would ask the server for its time zone, and set that time zone on the connection. You could also set the property manually.
Once set, all Date
s retrieved from MySQL would have the appropriate time zone set. This should not affect dates sent to MySQL as I believe they are sent as UTC anyway (but that should be looked into as well).
from mysql-nio.
Closing this out as not relevant at this point.
from mysql-nio.
Related Issues (20)
- Bump swift-crypto version range
- MySQLConnection closes unexpectedly in Swift Command Line Tool HOT 2
- MysqlNIO is missing MySQLData conformance for Data
- Could not importet using iPadOS 17.4 and Swift Playgrounds 4.4.1
- SimpleQuery vs Query with Date and UUID columns ? HOT 1
- Exception when reading MySQLTime formatted as text
- Investigate flaky CI HOT 1
- Support establishing connections over existing NIO channels HOT 1
- SocketAddress error (under Ventura) HOT 3
- error build: The package product 'Crypto' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 HOT 1
- Could not convert MySQL data to String: <MYSQL_TYPE_JSON> HOT 1
- Support connection reset
- Link to MSQLNIO API in Readme.md gives error 403 HOT 2
- Server-side Handler HOT 1
- Unhandled packet assertion. Can this throw instead? HOT 2
- MySql 8 MySQLConnectionHandler Fatal error: unhandled packet: HOT 3
- invalidProtocolVersion(255) when trying to connect to MySQL on Ubuntu HOT 3
- MySQLConnectionHandler.swift Fatal error: unhandled packet: ByteBuffer HOT 9
- High level transaction support? HOT 2
- Allow MySQLConnection creation without specifying an event loop
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 mysql-nio.