tauri-plugin-sql
tauri-plugin-sql copied to clipboard
"REAL NOT NULL" is not working in sqlite
This is the SQLite code
CREATE TABLE "Products" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "item" TEXT NOT NULL, "rate" REAL NOT NULL, "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP );
while entering values, it doesn't take "rate" at all, and always returns null
export async function CreateProducts(item, rate) { const { lastInsertId: id } = await db.execute( "INSERT INTO Products (item, rate) VALUES ($1,$2)", [item, rate] ); return { id, completed: true, }; }