Comments (1)
This may be helpful as a temporary workaround. Note this is using a timestamp data type / MySQL.
/**
When creating a Column, a default value can be specified. If a string
is provided, the MySQLConnection.packType() method wraps the value
with "\'". This makes sense if you are specifying a default value
that is constant, but means the generated query for a current_timestamp
default value doesn't work (MySQL wants current_timestamp, not \"current_timestamp\")
The workaround is to provide a String(describing: _) value, which is done here.
*/
public enum DefaultValues {
public static let currentTimestamp = CurrentTimestamp()
public static let updatingTimestamp = UpdatingCurrentTimestamp()
}
public class CurrentTimestamp: CustomStringConvertible {
public var description = "CURRENT_TIMESTAMP"
}
public class UpdatingCurrentTimestamp: CustomStringConvertible {
public var description = "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
}
from swift-kuery.
Related Issues (20)
- Does the QueryParams support 'LIKE' filter?
- Swift build wont succeed HOT 2
- Swift Build failing HOT 2
- Add support for triggers / ON UPDATE
- Cache built queries
- Support INSERT .. ON CONFLICT
- ConnectionPool does not expose connection errors
- Make API for retrieving results asynchronous HOT 1
- Prepare and Release SwiftKuery 3.0 HOT 1
- Kuery 3.0 migration guide HOT 1
- MySQLThreadSafeConnection on version 3.0.0 HOT 2
- Replace enum for `QueryBuilder` substitutions
- ODBC Support HOT 2
- Getting computed value after insert/update/delete. HOT 6
- Add reset statement for prepared statements HOT 1
- Generic created_at and updated_at for Table HOT 1
- Using in NIO EventLoopFuture chains? HOT 1
- DISTINCT doesn't seem to work with JOIN
- Parameter is not working with sub-request
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 swift-kuery.