Hello,

there's a need to make delete on cascade, update on cascade work.

I am using the next code for a test =>

int main()
{
    sql_q_raw_ptr = "pragma foreign_keys = 1;";
    mms::db db_;
    db_.open(path);
    db_.insert(sql_q_raw_ptr);
    sql_q_raw_ptr = "pragma foreign_keys;";
    auto selector = mms::sqlite3_selector("");
    db_.select(sql_q_raw_ptr, selector.get_data_handle(),
&selector.get_data());
    std::cout << selector.get_data().at(0) << '\n';
}

mms:: db class is a connection wrapper. Hence, sequential insert and select
in the code above are executed on the same connection. Each write-query
uses immediate transaction. Hence, the insert is executed as an immediate
transaction.
However, the output to the shell is 0.
When I execute the same code in sqliteman the output is 1.

Why there's 0 and if it is caused by the IMMEDIATE TRANSACTION then why?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to