本文整理汇总了C++中session::create_prepared_statement方法的典型用法代码示例。如果您正苦于以下问题:C++ session::create_prepared_statement方法的具体用法?C++ session::create_prepared_statement怎么用?C++ session::create_prepared_statement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类session
的用法示例。
在下文中一共展示了session::create_prepared_statement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SqliteModel
Logs::Logs(session sqliteDb) : SqliteModel(sqliteDb) {
insertWordLog = sqliteDb.create_prepared_statement(
"INSERT INTO words_logs ("
" word_id,"
" lang,"
" text,"
" action_id,"
" user_id,"
" event_type,"
" prev_lang,"
" prev_text,"
" event_date"
") "
"VALUES (?,?,?, ?,?,?,?,?,strftime('%s','now'));"
);
getLastWordActions = sqliteDb.create_prepared_statement(
"SELECT action_id, event_type, word_id, lang, text, user_id, event_date "
"FROM words_logs LIMIT 100;"
);
//
insertMetaLog = sqliteDb.create_prepared_statement(
"INSERT INTO metas_logs ("
" is_main,"
" word_id,"
" word_lang,"
" meta_key,"
" meta_value,"
" action_id,"
" user_id,"
" event_type,"
" prev_key,"
" prev_value,"
" event_date"
") "
"VALUES (?,?,? ,?,?, ?,?,?, ?,?, strftime('%s','now'));"
);
getLastMetaActions = sqliteDb.create_prepared_statement(
"SELECT"
" action_id,"
" event_type,"
" word_id,"
" word_lang,"
" meta_key,"
" meta_value,"
" user_id,"
" event_date "
"FROM metas_logs WHERE is_main = 1 "
"LIMIT 100;"
);
//
insertTransLog = sqliteDb.create_prepared_statement(
"INSERT INTO trans_logs ("
" is_main,"
" word1_id,"
" word2_id,"
" action_id,"
" user_id,"
" event_type,"
" event_date"
") "
"VALUES (?,?,?, ?,?,?,strftime('%s','now'));"
);
//
insertMeaningLog = sqliteDb.create_prepared_statement(
"INSERT INTO meanings_logs ("
" is_main,"
" meaning_id,"
" word_id,"
" action_id,"
" user_id,"
" event_type,"
" event_date"
") "
"VALUES (?,?,?, ?,?,?,strftime('%s','now'));"
);
//
insertTransMeaningLog = sqliteDb.create_prepared_statement(
"INSERT INTO meanings_trans_logs ("
" is_main,"
" meaning_id,"
" word_id,"
//.........这里部分代码省略.........