MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / test_schema_ddl_operations

Function test_schema_ddl_operations

graphlite/tests/ddl_shared_tests.rs:20–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19#[test]
20fn test_schema_ddl_operations() {
21 let fixture = get_shared_fixture();
22
23 // Create a schema within this test's isolated schema namespace
24 let test_schema = "business_schema";
25
26 // Test CREATE SCHEMA
27 fixture.assert_query_succeeds(&format!("CREATE SCHEMA IF NOT EXISTS {}", test_schema));
28
29 // Test schema creation without IF NOT EXISTS
30 fixture.assert_query_succeeds("CREATE SCHEMA new_schema");
31
32 // Test duplicate schema creation should fail
33 fixture.assert_query_fails("CREATE SCHEMA new_schema", "already exists");
34
35 // Test IF NOT EXISTS prevents errors
36 fixture.assert_query_succeeds("CREATE SCHEMA IF NOT EXISTS new_schema");
37
38 // Test DROP SCHEMA
39 fixture.assert_query_succeeds("DROP SCHEMA IF EXISTS new_schema");
40
41 // Test dropping non-existent schema with IF EXISTS
42 fixture.assert_query_succeeds("DROP SCHEMA IF EXISTS nonexistent_schema");
43
44 // Test dropping non-existent schema without IF EXISTS should fail
45 fixture.assert_query_fails("DROP SCHEMA nonexistent_schema_2", "not found");
46}
47
48#[test]
49fn test_drop_schema_basic() {

Callers

nothing calls this directly

Calls 3

get_shared_fixtureFunction · 0.85
assert_query_succeedsMethod · 0.45
assert_query_failsMethod · 0.45

Tested by

no test coverage detected