我尝试在Kotlin-Multiplatform项目中设置SQLDelight。目前,我只针对jvm。
在通用代码上运行gradle任务'generateJvmMainMyDatabaseInterface'时,失败并显示:
> Failed to compile SqliteCompoundSelectStmtImpl(COMPOUND_SELECT_STMT): [] :
SELECT * FROM test
当我删除selectNames: SELECT * FROM test;
下面代码的最后一部分时,它实际上可以工作。因此,像INSERT
和DELETE
这样的每条语句都可以,但SELECT
则不行。
CREATE TABLE test (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);
insertItem:
INSERT INTO test(name) VALUES (?);
addexample:
INSERT INTO test (name)
VALUES ('Ryan:Getzlaf');
DeleteContact:
DELETE FROM test WHERE id = ?;
selectNames:
SELECT * FROM test;
如何在SQLDelight上运行SELECT
命令?