Comments (6)
@bottlehall you can use .sql(raw: "TEXT")
if you want specifically the TEXT
datatype. AFAIK VARCHAR(255)
is still the recommended column type for "normal length" strings. In other words, a good fit for Fluent's .string
data type. However, I agree that .sql(.text)
should probably translate to using TEXT
in MySQL. It's a bit weird that would also use VARCHAR(255)
.
from mysql-kit.
Let me know if that seems right and if you'd like to submit a PR. Otherwise I will, thanks!
from mysql-kit.
@tanner0101, thanks. I will do a PR in the next few days.
from mysql-kit.
Tried doing a PR but it has errors during testing. Haven't checked them all exhaustively but this is indicative:
"MySQL error: Server error: BLOB, TEXT, GEOMETRY or JSON column 'name' can't have a default value"
from mysql-kit.
Error above arises because SQLBenchmarker+Planets.swift creates a test table with a 'name' field that is type .text
with a default value.
from mysql-kit.
Hmm... that's unfortunate. The easiest fix would be to check if db.dialect.name == "mysql"
and use VARCHAR(255)
explicitly. We can merge that through first then tests should pass for #291.
Going forward, maybe some method for getting a "best fit" type for a Swift type (like bestDataType<T>(for: T.Type) -> SQLExpression
) would be useful to add to SQLDialect
. Then we could change that line in the benchmark test to:
.column("name", type: .best(for: String.self), .default("Unamed Planet"))
from mysql-kit.
Related Issues (20)
- Decoding rows with null values to optionals fails
- 'SQLEnumSyntax' and 'SQLAlterTableSyntax' missing in MySQL-kit 4.0.0-beta.3.3 HOT 1
- Value of type 'DatabaseQuery' has no member 'idKey' - FluentMySQLDriver 4.0.0-beta.3 HOT 1
- FluentMySQLDriver crashes when saving dates HOT 4
- Build error on Swift CLI project HOT 4
- Cannot decode String from extracted JSON value
- Error when selecting from database HOT 1
- SimpleQuery fails decoding data version : +3.0.0 HOT 4
- conversion error should include data in question HOT 1
- Support encoding, and collation for database, table, and column HOT 4
- Crash on any mysql query HOT 1
- Rakan
- Question: how are broken connections handled by the pool? HOT 4
- Hostname Validation Error HOT 2
- hard to use in readme's code such as ... HOT 6
- SSH connection HOT 1
- Add api to support high level transaction HOT 2
- Connection CharacterSet is incorrectly determined HOT 5
- Not working with Swift Playground (4.4.1) on iPadOS 17.4. 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 mysql-kit.