@@ -1256,9 +1256,9 @@ mod tests {
12561256 ST_CLIENT_NAME , ST_COLUMN_ID , ST_COLUMN_NAME , ST_CONNECTION_CREDENTIALS_ID , ST_CONNECTION_CREDENTIALS_NAME ,
12571257 ST_CONSTRAINT_ID , ST_CONSTRAINT_NAME , ST_INDEX_ID , ST_INDEX_NAME , ST_MODULE_NAME , ST_RESERVED_SEQUENCE_RANGE ,
12581258 ST_ROW_LEVEL_SECURITY_ID , ST_ROW_LEVEL_SECURITY_NAME , ST_SCHEDULED_ID , ST_SCHEDULED_NAME , ST_SEQUENCE_ID ,
1259- ST_SEQUENCE_NAME , ST_TABLE_NAME , ST_VAR_ID , ST_VAR_NAME , ST_VIEW_ARG_ID , ST_VIEW_ARG_NAME , ST_VIEW_CLIENT_ID ,
1260- ST_VIEW_CLIENT_NAME , ST_VIEW_COLUMN_ID , ST_VIEW_COLUMN_NAME , ST_VIEW_ID , ST_VIEW_NAME , ST_VIEW_PARAM_ID ,
1261- ST_VIEW_PARAM_NAME ,
1259+ ST_SEQUENCE_NAME , ST_TABLE_NAME , ST_VAR_ID , ST_VAR_NAME , ST_VIEW_ARG_ID , ST_VIEW_ARG_NAME , ST_VIEW_COLUMN_ID ,
1260+ ST_VIEW_COLUMN_NAME , ST_VIEW_ID , ST_VIEW_NAME , ST_VIEW_PARAM_ID , ST_VIEW_PARAM_NAME , ST_VIEW_SUB_ID ,
1261+ ST_VIEW_SUB_NAME ,
12621262 } ;
12631263 use crate :: traits:: { IsolationLevel , MutTx } ;
12641264 use crate :: Result ;
@@ -1272,7 +1272,7 @@ mod tests {
12721272 use spacetimedb_lib:: error:: ResultTest ;
12731273 use spacetimedb_lib:: st_var:: StVarValue ;
12741274 use spacetimedb_lib:: { resolved_type_via_v9, ScheduleAt , TimeDuration } ;
1275- use spacetimedb_primitives:: { col_list, ColId , ScheduleId , ViewId } ;
1275+ use spacetimedb_primitives:: { col_list, ArgId , ColId , ScheduleId , ViewId } ;
12761276 use spacetimedb_sats:: algebraic_value:: ser:: value_serialize;
12771277 use spacetimedb_sats:: bsatn:: ToBsatn ;
12781278 use spacetimedb_sats:: layout:: RowTypeLayout ;
@@ -1715,7 +1715,7 @@ mod tests {
17151715 TableRow { id: ST_VIEW_ID . into( ) , name: ST_VIEW_NAME , ty: StTableType :: System , access: StAccess :: Public , primary_key: Some ( StViewFields :: ViewId . into( ) ) } ,
17161716 TableRow { id: ST_VIEW_PARAM_ID . into( ) , name: ST_VIEW_PARAM_NAME , ty: StTableType :: System , access: StAccess :: Public , primary_key: None } ,
17171717 TableRow { id: ST_VIEW_COLUMN_ID . into( ) , name: ST_VIEW_COLUMN_NAME , ty: StTableType :: System , access: StAccess :: Public , primary_key: None } ,
1718- TableRow { id: ST_VIEW_CLIENT_ID . into( ) , name: ST_VIEW_CLIENT_NAME , ty: StTableType :: System , access: StAccess :: Public , primary_key: None } ,
1718+ TableRow { id: ST_VIEW_SUB_ID . into( ) , name: ST_VIEW_SUB_NAME , ty: StTableType :: System , access: StAccess :: Public , primary_key: None } ,
17191719 TableRow { id: ST_VIEW_ARG_ID . into( ) , name: ST_VIEW_ARG_NAME , ty: StTableType :: System , access: StAccess :: Public , primary_key: Some ( StViewArgFields :: Id . into( ) ) } ,
17201720
17211721 ] ) ) ;
@@ -1793,10 +1793,12 @@ mod tests {
17931793 ColRow { table: ST_VIEW_COLUMN_ID . into( ) , pos: 2 , name: "col_name" , ty: AlgebraicType :: String } ,
17941794 ColRow { table: ST_VIEW_COLUMN_ID . into( ) , pos: 3 , name: "col_type" , ty: AlgebraicType :: bytes( ) } ,
17951795
1796- ColRow { table: ST_VIEW_CLIENT_ID . into( ) , pos: 0 , name: "view_id" , ty: ViewId :: get_type( ) } ,
1797- ColRow { table: ST_VIEW_CLIENT_ID . into( ) , pos: 1 , name: "arg_id" , ty: AlgebraicType :: U64 } ,
1798- ColRow { table: ST_VIEW_CLIENT_ID . into( ) , pos: 2 , name: "identity" , ty: AlgebraicType :: U256 } ,
1799- ColRow { table: ST_VIEW_CLIENT_ID . into( ) , pos: 3 , name: "connection_id" , ty: AlgebraicType :: U128 } ,
1796+ ColRow { table: ST_VIEW_SUB_ID . into( ) , pos: 0 , name: "view_id" , ty: ViewId :: get_type( ) } ,
1797+ ColRow { table: ST_VIEW_SUB_ID . into( ) , pos: 1 , name: "arg_id" , ty: ArgId :: get_type( ) } ,
1798+ ColRow { table: ST_VIEW_SUB_ID . into( ) , pos: 2 , name: "identity" , ty: AlgebraicType :: U256 } ,
1799+ ColRow { table: ST_VIEW_SUB_ID . into( ) , pos: 3 , name: "num_subscribers" , ty: AlgebraicType :: U64 } ,
1800+ ColRow { table: ST_VIEW_SUB_ID . into( ) , pos: 4 , name: "has_subscribers" , ty: AlgebraicType :: Bool } ,
1801+ ColRow { table: ST_VIEW_SUB_ID . into( ) , pos: 5 , name: "last_called" , ty: AlgebraicType :: I64 } ,
18001802
18011803 ColRow { table: ST_VIEW_ARG_ID . into( ) , pos: 0 , name: "id" , ty: AlgebraicType :: U64 } ,
18021804 ColRow { table: ST_VIEW_ARG_ID . into( ) , pos: 1 , name: "bytes" , ty: AlgebraicType :: bytes( ) } ,
@@ -1820,8 +1822,8 @@ mod tests {
18201822 IndexRow { id: 15 , table: ST_VIEW_ID . into( ) , col: col( 1 ) , name: "st_view_view_name_idx_btree" , } ,
18211823 IndexRow { id: 16 , table: ST_VIEW_PARAM_ID . into( ) , col: col_list![ 0 , 1 ] , name: "st_view_param_view_id_param_pos_idx_btree" , } ,
18221824 IndexRow { id: 17 , table: ST_VIEW_COLUMN_ID . into( ) , col: col_list![ 0 , 1 ] , name: "st_view_column_view_id_col_pos_idx_btree" , } ,
1823- IndexRow { id: 18 , table: ST_VIEW_CLIENT_ID . into( ) , col: col_list! [ 0 , 1 ] , name: "st_view_client_view_id_arg_id_idx_btree " , } ,
1824- IndexRow { id: 19 , table: ST_VIEW_CLIENT_ID . into( ) , col: col_list! [ 2 , 3 ] , name: "st_view_client_identity_connection_id_idx_btree " , } ,
1825+ IndexRow { id: 18 , table: ST_VIEW_SUB_ID . into( ) , col: col ( 2 ) , name: "st_view_sub_identity_idx_btree " , } ,
1826+ IndexRow { id: 19 , table: ST_VIEW_SUB_ID . into( ) , col: col ( 4 ) , name: "st_view_sub_has_subscribers_idx_btree " , } ,
18251827 IndexRow { id: 20 , table: ST_VIEW_ARG_ID . into( ) , col: col( 0 ) , name: "st_view_arg_id_idx_btree" , } ,
18261828 IndexRow { id: 21 , table: ST_VIEW_ARG_ID . into( ) , col: col( 1 ) , name: "st_view_arg_bytes_idx_btree" , } ,
18271829 ] ) ) ;
@@ -2282,8 +2284,8 @@ mod tests {
22822284 IndexRow { id : 15 , table : ST_VIEW_ID . into ( ) , col : col ( 1 ) , name : "st_view_view_name_idx_btree" , } ,
22832285 IndexRow { id : 16 , table : ST_VIEW_PARAM_ID . into ( ) , col : col_list ! [ 0 , 1 ] , name : "st_view_param_view_id_param_pos_idx_btree" , } ,
22842286 IndexRow { id : 17 , table : ST_VIEW_COLUMN_ID . into ( ) , col : col_list ! [ 0 , 1 ] , name : "st_view_column_view_id_col_pos_idx_btree" , } ,
2285- IndexRow { id : 18 , table : ST_VIEW_CLIENT_ID . into ( ) , col : col_list ! [ 0 , 1 ] , name : "st_view_client_view_id_arg_id_idx_btree " , } ,
2286- IndexRow { id : 19 , table : ST_VIEW_CLIENT_ID . into ( ) , col : col_list ! [ 2 , 3 ] , name : "st_view_client_identity_connection_id_idx_btree " , } ,
2287+ IndexRow { id : 18 , table : ST_VIEW_SUB_ID . into ( ) , col : col ( 2 ) , name : "st_view_sub_identity_idx_btree " , } ,
2288+ IndexRow { id : 19 , table : ST_VIEW_SUB_ID . into ( ) , col : col ( 4 ) , name : "st_view_sub_has_subscribers_idx_btree " , } ,
22872289 IndexRow { id : 20 , table : ST_VIEW_ARG_ID . into ( ) , col : col ( 0 ) , name : "st_view_arg_id_idx_btree" , } ,
22882290 IndexRow { id : 21 , table : ST_VIEW_ARG_ID . into ( ) , col : col ( 1 ) , name : "st_view_arg_bytes_idx_btree" , } ,
22892291 IndexRow { id : seq_start, table : FIRST_NON_SYSTEM_ID , col : col ( 0 ) , name : "Foo_id_idx_btree" , } ,
0 commit comments