plugin.go ×5

Frontier kind: Code frontier

unlabeled · c_4ff7c796375c

415 tests · 3044 LOC · 149 files · introduces 0 tests · 21 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges21 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
478 ranges3044 lines · 149 files · Browse complete extent
All tests (intent)
415 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.

2 files ranked by introduced lines: 21 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite/plugin.go 11 introduced LOC · 5 ranges

Open complete file

127 // from being reaped, which would destroy the database.
128 if cfg.ConnectAttributes["mode"] == "memory" {
129 > db.SetConnMaxIdleTime(0) plugin.go
130 > }
131
132 // Maps struct names in CamelCase to snake without need for db struct tags.
134
135 switch {
136 > case cfg.ConnectAttributes["mode"] == "memory": plugin.go
137 > // creates temporary DB overlay in order to configure database and schemas
138 > if err := p.setupSQLiteDatabase(cfg, db, logger); err != nil {
139 _ = db.Close()
140 return nil, err
150 }
151
152 > func (p *plugin) setupSQLiteDatabase(cfg *config.SQL, conn *sqlx.DB, logger log.Logger) error { plugin.go
153 > db := newDB(sqlplugin.DbKindUnknown, cfg.DatabaseName, conn, nil, logger)
154 > defer func() { _ = db.Close() }()
155
156 > err := db.CreateDatabase(cfg.DatabaseName) plugin.go
157 > if err != nil {
158 return err
159 }
160
161 // init tables
162 > return sqliteschema.SetupSchemaOnDB(db) plugin.go
163 }
164
go.temporal.io/server/schema/sqlite/setup.go 10 introduced LOC · 5 ranges

Open complete file

47 //
48 // Note: this function may receive breaking changes or be removed in the future.
49 > func SetupSchemaOnDB(db sqlplugin.AdminDB) error { setup.go
50 > statements, err := p.LoadAndSplitQueryFromReaders([]io.Reader{bytes.NewBuffer(executionSchema)})
51 > if err != nil {
52 return fmt.Errorf("error loading execution schema: %w", err)
53 }
54
55 > for _, stmt := range statements { setup.go
56 > if err = db.Exec(stmt); err != nil {
57 return fmt.Errorf("error executing statement %q: %w", stmt, err)
58 }
59 }
60
61 > statements, err = p.LoadAndSplitQueryFromReaders([]io.Reader{bytes.NewBuffer(visibilitySchema)}) setup.go
62 > if err != nil {
63 return fmt.Errorf("error loading visibility schema: %w", err)
64 }
65
66 > for _, stmt := range statements { setup.go
67 > if err = db.Exec(stmt); err != nil {
68 return fmt.Errorf("error executing statement %q: %w", stmt, err)
69 }
70 }
71
72 > return nil setup.go
73 }
74