MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_cache_invalidation

Function test_cache_invalidation

src/validator/string_constraints.rs:324–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

322
323 #[test]
324 fn test_cache_invalidation() {
325 let validator = StringConstraintValidator::new();
326 let conn = setup_test_db();
327
328 // Add a constraint
329 conn.execute(
330 "INSERT INTO __pgsqlite_string_constraints (table_name, column_name, max_length, is_char_type)
331 VALUES ('users', 'name', 10, 0)",
332 [],
333 ).unwrap();
334
335 // Load constraints
336 validator.load_table_constraints(&conn, "users").unwrap();
337 assert!(validator.table_has_constraints("users"));
338
339 // Invalidate
340 validator.invalidate_table("users");
341 assert!(!validator.table_has_constraints("users"));
342 }
343}

Callers

nothing calls this directly

Calls 4

setup_test_dbFunction · 0.70
executeMethod · 0.45
invalidate_tableMethod · 0.45

Tested by

no test coverage detected