Closed vycoder closed 1 year ago
My bad. Closing this issue. SQLite does accept TEXT as primary key it seems. My issue is just my own stupidity, i was editing a duplicate my schema, the schema json that wasn't the actual file being imported. That' why I keep getting weird errors. It was only on that table that's failing, my original implementation was correct. I need to sleep
@vycoder 👍
I had everything setup nicely. But I have my schema on local JSON. I'm importing it via
importFromJSON()
Problem is, when i save an entity. It errors out with:
Even though my entity has
@PrimaryGeneratedColumn
on it. The only thing that seem to work is when I use@PrimaryGeneratedColumn('uuid')
, the supplied value is no longerNULL
but indeed a generated uuid. Unfortunately though, I'm also having trouble with this, sometimes it errors out as well withcode error 20
, I think it was because SQLite does not seem to accept a primary key ofTEXT
. Was able to confirm that bit, when I manually setfavorites.id
into any number. It works alright that way.But isn't the point of
@PrimaryGeneratedColumn
so that I don't have to generate it myself?I even tried doing:
@PrimaryGeneratedColumn('increment')
@PrimaryGeneratedColumn('increment', { type: 'integer' })
@PrimaryGeneratedColumn('identity', { name: 'id', type: 'integer', generatedIdentity: 'Always' })
But nothing's working. Do I really have to manually generate an id?