(t *testing.T, name string, withSchema bool)
| 845 | } |
| 846 | |
| 847 | func createSQLiteDBFile(t *testing.T, name string, withSchema bool) string { |
| 848 | t.Helper() |
| 849 | |
| 850 | dbPath := filepath.Join(t.TempDir(), name) |
| 851 | db, err := sql.Open("sqlite", dbPath) |
| 852 | if err != nil { |
| 853 | t.Fatalf("open sqlite: %v", err) |
| 854 | } |
| 855 | defer db.Close() |
| 856 | |
| 857 | if withSchema { |
| 858 | for _, stmt := range []string{ |
| 859 | `CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)`, |
| 860 | `INSERT INTO users (id, name) VALUES (1, 'Ada')`, |
| 861 | } { |
| 862 | if _, err := db.Exec(stmt); err != nil { |
| 863 | t.Fatalf("exec %q: %v", stmt, err) |
| 864 | } |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | return dbPath |
| 869 | } |
| 870 | |
| 871 | func newMetadataReloadMCPServer(t *testing.T, autoCodeRelations bool, codeDatabases []string, inferA, inferB bool) *mcpServer { |
| 872 | t.Helper() |
no test coverage detected