MCPcopy Create free account
hub / github.com/SqliteModernCpp/sqlite_modern_cpp / step

Function step

hdr/sqlite_modern_cpp.h:912–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

910 typename Functions
911 >
912 inline void step(
913 sqlite3_context* db,
914 int count,
915 sqlite3_value** vals
916 ) {
917 auto ctxt = static_cast<AggregateCtxt<ContextType>*>(sqlite3_aggregate_context(db, sizeof(AggregateCtxt<ContextType>)));
918 if(!ctxt) return;
919 try {
920 if(!ctxt->constructed) new(ctxt) AggregateCtxt<ContextType>();
921 step<Count, Functions>(db, count, vals, ctxt->obj);
922 return;
923 } catch(sqlite_exception &e) {
924 sqlite3_result_error_code(db, e.get_code());
925 sqlite3_result_error(db, e.what(), -1);
926 } catch(std::exception &e) {
927 sqlite3_result_error(db, e.what(), -1);
928 } catch(...) {
929 sqlite3_result_error(db, "Unknown error", -1);
930 }
931 if(ctxt && ctxt->constructed)
932 ctxt->~AggregateCtxt();
933 }
934
935 template<
936 std::size_t Count,

Callers

nothing calls this directly

Calls 2

get_val_from_dbFunction · 0.85
get_codeMethod · 0.80

Tested by

no test coverage detected