Can't insert into MySQL table without auto index
See original GitHub issueI’m trying to insert a simple row into a table:
transaction {
GuildPrefixTable.insert {
it[id]._value = event.guild.idLong
it[prefix] = ""//event.guild.idLong
}
}
it doesn’t throw an error but it never actually inserts anything (even if I remove the line setting it[id]._value. The table is defined as:
object GuildPrefixTable : LongIdTable("guild_prefix") {
val prefix = text("prefix")
}
class GuildPrefix(id: EntityID<Long>) : LongEntity(id) {
companion object : LongEntityClass<GuildPrefix>(GuildPrefixTable)
var prefix by GuildPrefixTable.prefix
}
and in MySQL, the table is just id
(bigint(20), not automatic primary key), prefix
(tinytext)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
I can't insert a row into table with auto_increment column
I have set the auto increment as 1 and truncated table also, but.. it still doesn't work.. I have no idea how to...
Read more >MySQL 8.0 Reference Manual :: 13.2.7 INSERT Statement
INSERT with an ON DUPLICATE KEY UPDATE clause enables existing rows to be updated if a row to be inserted would cause a...
Read more >How to INSERT If Row Does Not Exist (UPSERT) in MySQL
Learn how to INSERT an If Row Does Not Exist (UPSERT) in MySQL. MySQL provides a number of useful statements when it is...
Read more >How to Work with Auto-Incrementing IDs in SQL - Retool
Intro: auto-incrementing fields and primary keys; Create a table with auto-incrementing IDs; Changing increment values; Insert ...
Read more >How to Use PHP to Insert Data Into MySQL Database
In this tutorial, you will learn how to INSERT data into your MySQL database from PHP scripts. There are two methods that you...
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
Seems like it does work, thank you! I’d update the version given on the Getting Started page, it’d help beginners “fix” issues like this one
Yes, please try with the latest version.