MySQL Verifying as Sqlite
See original GitHub issueBuild Environment SQLDelight version: 1.5.0 OS: macOS Catalina 10.15.7 Gradle version: 6.8 Kotlin version: 1.4
I’m setting up a new project and have sqldelight configured for mysql. It will generate interfaces fine, but verification fails with a sqlite error saying AUTO_INCREMENT is not valid.
The error:
Execution failed for task ':verifyMainDatabaseMigration'.
A failure occurred while executing com.squareup.sqldelight.gradle.VerifyMigrationTask$VerifyMigrationAction
[SQLITE_ERROR] SQL error or missing database (near "AUTO_INCREMENT": syntax error)
Sq file:
CREATE TABLE users (
id int(11) NOT NULL AUTO_INCREMENT
);
build.gradle.kts
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.squareup.sqldelight:gradle-plugin:1.5.0")
}
}
plugins {
kotlin("jvm") version "1.4.32"
application
id("com.squareup.sqldelight")
}
group = "api.sample"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
implementation("com.squareup.sqldelight:gradle-plugin:1.5.0")
implementation("com.squareup.sqldelight:jdbc-driver:1.5.0")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "13"
}
application {
mainClassName = "MainKt"
}
sqldelight {
database("Database") { // This will be the name of the generated database class.
packageName = "com.sample.test"
dialect = "mysql"
}
}
settings.gradle.kts
rootProject.name = "KotlinSample"
pluginManagement {
repositories {
google()
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if(requested.id.namespace == "com.squareup") {
useModule("com.squareup.sqldelight:gradle-plugin:1.5.0")
}
}
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:15
Top Results From Across the Web
How to Migrate from SQLite to MySQL: 2 Easy Methods - Learn
The quickest and easiest way to convert SQLite to MySQL is by exporting an SQL Database to a Dump File, and then importing...
Read more >MySQL-SQLite
Set the Connection Name to root. Everything else should be in place already. If your password is not empty, enter it into the...
Read more >Exporting a MySQL database for import into SQLite
If you want to export both the structure and the data, check this.) Click Go. A file called databasename.sql will be created and...
Read more >Converting SQLite to MySQL script (Check if correct)
i just wrote a small script to port sqlite table to mysql but im realy not sure if i did right. Im atleast...
Read more >MySQL vs. SQLite - Towards Data Science
Both MySQL and SQLite are forms of a Relational Database Management System (RDBMS). These are based on the Structured Query Language (SQL). In ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not the greatest at gradle, but it’s the one at KotlinSample > Tasks > build > build
I’m encountering a similar issue:
I don’t have any .db file or db package and I’m on the latest plugin 1.5.3 using Postgres.