nsmcp::AccessRecordStoreSQLite method allScope (public)

 <instance of nsmcp::AccessRecordStoreSQLite[i]> allScope

Defined in /usr/local/ns/tcl/nsmcp/log-traffic-record-store.tcl

Open a query scope covering every active stored generation. Create the source-scope table and retained-record view in a read transaction. This enables complete-generation rollup queries; call finish after querying.

Returns:
An empty result after the all-generation scope is ready.

Testcases:
No testcase defined.
Source code:
set :fullScope true
if {${:mode} eq "reader"} {
    ${:db} execute {PRAGMA query_only=OFF}
}
${:db} execute BEGIN
set :querying true
${:db} execute {
    DROP VIEW IF EXISTS temp.nsmcp_record_window; DROP TABLE IF EXISTS temp.nsmcp_scan_batch; DROP TABLE IF
    EXISTS temp.nsmcp_record_scope;
    CREATE TEMP TABLE nsmcp_record_scope(fid INTEGER PRIMARY KEY,lo INTEGER,hi INTEGER);
    INSERT INTO temp.nsmcp_record_scope SELECT fid,0,high FROM main.files WHERE active=1
}
set floor [:retentionFloor]
${:db} execute "
    CREATE TEMP VIEW nsmcp_record_window AS SELECT r.* FROM main.rows r JOIN temp.nsmcp_record_scope s
    ON r.fid=s.fid AND r.off>=s.lo AND r.stop<=s.hi WHERE r.kind<>0 OR r.t>=$floor
"
if {${:mode} eq "reader"} {
    ${:db} execute {PRAGMA query_only=ON}
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: