-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand SQLDataType options #65
Comments
You can pass any try self.db.create(table: "galaxies")
.column("id", type: SQLRaw("INTEGER"), SQLRaw("UNIQUE"))
.column("name", type: SQLRaw("VARCHAR"))
.run().wait() That said, maybe we could have |
+1 |
The +1 is for solving it with ' SQLDataType integrate with SQLDialect' |
+1 |
This solution does work, although it needs to be expressed as either try self.db.create(table: "galaxies")
.column("id", type: .custom(SQLRaw("INTEGER")), .custom(SQLRaw("UNIQUE")))
.column("name", type: .custom(SQLRaw("VARCHAR")))
.run().wait() or try self.db.create(table: "galaxies")
.column(SQLRaw("id"), type: SQLRaw("INTEGER"), SQLRaw("UNIQUE"))
.column(SQLRaw("name"), type: SQLRaw("VARCHAR"))
.run().wait() |
|
Code snippet
Generates SQL as
CREATE TABLE "galaxies"("id" INTEGER PRIMARY KEY DEFAULT UNIQUE, "name" TEXT)
The data type TEXT is not part of SQL 92, and is not recognized by Frontbase. There needs to be some way to declare or alias to a VARCHAR or CHARACTER VARYING type.
Vapor 3 was more flexible.
(Autoincrement is implemented in Frontbase by setting the default to the UNIQUE function).
The text was updated successfully, but these errors were encountered: