admin.go ×4

Frontier kind: Code frontier

unlabeled · c_315ae649044b

38 tests · 4507 LOC · 195 files · introduces 0 tests · 43 LOC · 5 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges43 lines · 5 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
849 ranges4507 lines · 195 files · Browse complete extent
All tests (intent)
38 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

5 files ranked by introduced lines: 43 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/persistence-tests/setup.go 18 introduced LOC · 1 range

Open complete file

107
108 // GetSQLiteFileTestClusterOption return test options
109 > func GetSQLiteFileTestClusterOption() *TestBaseOptions { setup.go
110 > return &TestBaseOptions{
111 > SQLDBPluginName: sqlite.PluginName,
112 > DBName: filepath.Join(os.TempDir(), GenerateRandomDBName()), // put files in temp to avoid cluttering the project
113 > DBUsername: testSQLiteUser,
114 > DBPassword: testSQLitePassword,
115 > DBHost: environment.GetLocalhostIP(),
116 > DBPort: 0,
117 > SchemaDir: testSQLiteSchemaDir,
118 > StoreType: config.StoreTypeSQL,
119 > ConnectAttributes: map[string]string{
120 > "cache": "shared",
121 > "busy_timeout": "30000",
122 > "journal_mode": "wal",
123 > "synchronous": "normal",
124 > },
125 > }
126 > }
127
128 // GetSQLiteMemoryTestClusterOption return test options
go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite/admin.go 10 introduced LOC · 4 ranges

Open complete file

37
38 // CreateSchemaVersionTables sets up the schema version tables
39 > func (mdb *db) CreateSchemaVersionTables() error { admin.go
40 > if err := mdb.Exec(createSchemaVersionTableQuery); err != nil {
41 return err
42 }
43 > return mdb.Exec(createSchemaUpdateHistoryTableQuery) admin.go
44 }
45
52
53 // UpdateSchemaVersion updates the schema version for the keyspace
54 > func (mdb *db) UpdateSchemaVersion(database string, newVersion string, minCompatibleVersion string) error { admin.go
55 > return mdb.Exec(writeSchemaVersionQuery, database, time.Now().UTC(), newVersion, minCompatibleVersion)
56 > }
57
58 // WriteSchemaUpdateLog adds an entry to the schema update history table
59 > func (mdb *db) WriteSchemaUpdateLog(oldVersion string, newVersion string, manifestMD5 string, desc string) error { admin.go
60 > now := time.Now().UTC()
61 > return mdb.Exec(writeSchemaUpdateHistoryQuery, now.Year(), int(now.Month()), now, oldVersion, newVersion, manifestMD5, desc)
62 > }
63
64 // Exec executes a sql statement
go.temporal.io/server/common/persistence/sql/test_sql_persistence.go 10 introduced LOC · 2 ranges

Open complete file

127
128 if cfg2.PluginName == "sqlite" && cfg2.DatabaseName != ":memory:" && cfg2.ConnectAttributes["mode"] != "memory" {
129 > if len(cfg2.DatabaseName) > 3 { // 3 should mean not ., .., empty, or / test_sql_persistence.go
130 > // Remove main database file
131 > _ = os.Remove(cfg2.DatabaseName)
132 > // Remove WAL mode files (may not exist if WAL wasn't used)
133 > _ = os.Remove(cfg2.DatabaseName + "-wal")
134 > _ = os.Remove(cfg2.DatabaseName + "-shm")
135 > }
136 > return
137 }
138
163
164 if rewriter, ok := db.(sqlplugin.SchemaStatementRewriter); ok {
165 > statements = rewriter.RewriteSchemaStatements(statements) test_sql_persistence.go
166 > }
167
168 for i, stmt := range statements {
go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite/db.go 4 introduced LOC · 1 range

Open complete file

106
107 // ExpectedVersion returns expected version.
108 > func (mdb *db) ExpectedVersion() string { db.go
109 > switch mdb.dbKind {
110 > case sqlplugin.DbKindMain:
111 > return sqliteschema.Version
112 case sqlplugin.DbKindVisibility:
113 return sqliteschema.VisibilityVersion
go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite/plugin.go 1 introduced LOC · 1 range

Open complete file

203
204 // assume pragma
205 > parameters.Add("_pragma", fmt.Sprintf("%s=%s", key, value)) plugin.go
206 }
207 // set time format