tauri-plugin-sql icon indicating copy to clipboard operation
tauri-plugin-sql copied to clipboard

"REAL NOT NULL" is not working in sqlite

Open Jaydeep189 opened this issue 3 years ago • 0 comments

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, }; }

Jaydeep189 avatar Jul 16 '22 05:07 Jaydeep189