Skip to content

Commit

Permalink
feat(1329): System table for system variables
Browse files Browse the repository at this point in the history
Closes #1329.

Used to persist global parameters for slow query logging and cardinality limits.
  • Loading branch information
joshua-spacetime committed Jun 5, 2024
1 parent b06b2e5 commit 563a3d3
Show file tree
Hide file tree
Showing 7 changed files with 530 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crates/core/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::util::slow::SlowQueryConfig;
use spacetimedb_sats::relation::{Column, FieldName, Header};
use spacetimedb_lib::relation::{Column, FieldName, Header};
use spacetimedb_sats::{product, AlgebraicType, AlgebraicValue};
use spacetimedb_vm::errors::{ConfigError, ErrorVm};
use spacetimedb_vm::relation::MemTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
SystemTable, ST_CLIENTS_ID, ST_CLIENT_IDX, ST_COLUMNS_ID, ST_COLUMNS_IDX, ST_COLUMNS_NAME,
ST_CONSTRAINTS_ID, ST_CONSTRAINTS_IDX, ST_CONSTRAINTS_NAME, ST_INDEXES_ID, ST_INDEXES_IDX,
ST_INDEXES_NAME, ST_MODULE_ID, ST_MODULE_IDX, ST_RESERVED_SEQUENCE_RANGE, ST_SEQUENCES_ID,
ST_SEQUENCES_IDX, ST_SEQUENCES_NAME, ST_TABLES_ID, ST_TABLES_IDX,
ST_SEQUENCES_IDX, ST_SEQUENCES_NAME, ST_TABLES_ID, ST_TABLES_IDX, ST_VAR_ID, ST_VAR_IDX,
},
traits::TxData,
},
Expand Down Expand Up @@ -204,6 +204,8 @@ impl CommittedState {

self.create_table(ST_CLIENTS_ID, schemas[ST_CLIENT_IDX].clone());

self.create_table(ST_VAR_ID, schemas[ST_VAR_IDX].clone());

// Insert the sequences into `st_sequences`
let (st_sequences, blob_store) =
self.get_table_and_blob_store_or_create(ST_SEQUENCES_ID, &schemas[ST_SEQUENCES_IDX]);
Expand Down
Loading

0 comments on commit 563a3d3

Please sign in to comment.