oatpp / oatpp-sqlite

SQLite adapter for oatpp ORM.
https://oatpp.io/
Apache License 2.0
20 stars 18 forks source link

foreign_keys not work. #18

Open kekxv opened 1 year ago

kekxv commented 1 year ago

PRAGMA foreign_keys=ON;

kekxv commented 1 year ago

it works under bazel:

    maybe(
        new_git_repository,
        name = "oatpp_sqlite",
        build_file_content = all_sqlite_content,
        init_submodules = True,
        # tag = "v0.16.5",
        commit = "c62750793e572f8692a242e731596a098e480ac3",
        shallow_since = "1651060543 +0300",
        remote = "https://github.com/oatpp/oatpp-sqlite.git",
        patch_cmds = [
            "sed -i.bak 's/\\/oatpp-${OATPP_MODULE_VERSION}\\/${OATPP_MODULE_NAME}/\\//g' cmake/module-install.cmake",
            # TODO enable foreign_keys
            "sed -i.bak 's/auto sqliteConn = std::static_pointer_cast<sqlite::Connection>(conn.object);/auto sqliteConn = std::static_pointer_cast<sqlite::Connection>(conn.object);sqlite3_exec(sqliteConn->getHandle(), \"PRAGMA foreign_keys=ON;\", NULL, NULL, NULL);/g' src/oatpp-sqlite/Executor.cpp",
        ],
    )