sqlite-hub 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -6
- package/changelog.md +12 -0
- package/{js → frontend/js}/api.js +7 -0
- package/{js → frontend/js}/app.js +87 -3
- package/{js → frontend/js}/components/connectionCard.js +8 -9
- package/frontend/js/components/connectionLogo.js +33 -0
- package/{js → frontend/js}/components/emptyState.js +25 -11
- package/{js → frontend/js}/components/modal.js +131 -0
- package/{js → frontend/js}/components/rowEditorPanel.js +63 -33
- package/{js → frontend/js}/components/sidebar.js +8 -3
- package/{js → frontend/js}/store.js +236 -1
- package/{js → frontend/js}/views/data.js +106 -9
- package/{js → frontend/js}/views/editor.js +4 -0
- package/{js → frontend/js}/views/structure.js +10 -12
- package/{styles → frontend/styles}/structure-graph.css +5 -10
- package/package.json +3 -3
- package/{publish_brew.sh → scripts/publish_brew.sh} +2 -2
- package/{publish_npm.sh → scripts/publish_npm.sh} +2 -2
- package/server/data/db_logos/.gitkeep +0 -0
- package/server/routes/connections.js +2 -0
- package/server/routes/data.js +14 -0
- package/server/server.js +29 -6
- package/server/services/sqlite/connectionManager.js +68 -33
- package/server/services/sqlite/dataBrowserService.js +30 -0
- package/server/services/storage/appStateStore.js +159 -20
- package/server/utils/appPaths.js +42 -18
- /package/{assets → frontend/assets}/images/logo.webp +0 -0
- /package/{assets → frontend/assets}/images/logo_extrasmall.webp +0 -0
- /package/{assets → frontend/assets}/images/logo_raw.png +0 -0
- /package/{assets → frontend/assets}/images/logo_small.webp +0 -0
- /package/{assets → frontend/assets}/mockups/connections.png +0 -0
- /package/{assets → frontend/assets}/mockups/data.png +0 -0
- /package/{assets → frontend/assets}/mockups/data_edit.png +0 -0
- /package/{assets → frontend/assets}/mockups/graph_visualize.png +0 -0
- /package/{assets → frontend/assets}/mockups/home.png +0 -0
- /package/{assets → frontend/assets}/mockups/overview.png +0 -0
- /package/{assets → frontend/assets}/mockups/sql_editor.png +0 -0
- /package/{assets → frontend/assets}/mockups/structure.png +0 -0
- /package/{index.html → frontend/index.html} +0 -0
- /package/{js → frontend/js}/components/actionBar.js +0 -0
- /package/{js → frontend/js}/components/appShell.js +0 -0
- /package/{js → frontend/js}/components/badges.js +0 -0
- /package/{js → frontend/js}/components/bottomTabs.js +0 -0
- /package/{js → frontend/js}/components/dataGrid.js +0 -0
- /package/{js → frontend/js}/components/metricCard.js +0 -0
- /package/{js → frontend/js}/components/pageHeader.js +0 -0
- /package/{js → frontend/js}/components/queryEditor.js +0 -0
- /package/{js → frontend/js}/components/queryResults.js +0 -0
- /package/{js → frontend/js}/components/statusBar.js +0 -0
- /package/{js → frontend/js}/components/structureGraph.js +0 -0
- /package/{js → frontend/js}/components/toast.js +0 -0
- /package/{js → frontend/js}/components/topNav.js +0 -0
- /package/{js → frontend/js}/lib/cytoscapeRuntime.js +0 -0
- /package/{js → frontend/js}/router.js +0 -0
- /package/{js → frontend/js}/utils/format.js +0 -0
- /package/{js → frontend/js}/views/connections.js +0 -0
- /package/{js → frontend/js}/views/landing.js +0 -0
- /package/{js → frontend/js}/views/overview.js +0 -0
- /package/{js → frontend/js}/views/settings.js +0 -0
- /package/{styles → frontend/styles}/base.css +0 -0
- /package/{styles → frontend/styles}/components.css +0 -0
- /package/{styles → frontend/styles}/layout.css +0 -0
- /package/{styles → frontend/styles}/tokens.css +0 -0
- /package/{styles → frontend/styles}/views.css +0 -0
- /package/{data → server/data}/.gitkeep +0 -0
package/server/utils/appPaths.js
CHANGED
|
@@ -6,6 +6,13 @@ const APP_NAME = "sqlite-hub";
|
|
|
6
6
|
const APP_STATE_DB_FILENAME = "sqlite-hub-state.db";
|
|
7
7
|
const LEGACY_STATE_FILENAME = "app-state.json";
|
|
8
8
|
|
|
9
|
+
function resolvePackagedDataDirectories(packageRoot) {
|
|
10
|
+
return [
|
|
11
|
+
path.resolve(packageRoot, "server", "data"),
|
|
12
|
+
path.resolve(packageRoot, "data"),
|
|
13
|
+
].filter((candidatePath, index, candidates) => candidates.indexOf(candidatePath) === index);
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
function resolveAppStateDirectory() {
|
|
10
17
|
const homeDirectory = os.homedir();
|
|
11
18
|
|
|
@@ -28,7 +35,7 @@ function resolveAppStateDirectory() {
|
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
function resolvePackagedDataDirectory(packageRoot) {
|
|
31
|
-
return
|
|
38
|
+
return resolvePackagedDataDirectories(packageRoot)[0];
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
function resolvePackagedAppStateDbPath(packageRoot) {
|
|
@@ -36,7 +43,11 @@ function resolvePackagedAppStateDbPath(packageRoot) {
|
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
function resolvePackagedLegacyStatePath(packageRoot) {
|
|
39
|
-
|
|
46
|
+
const candidates = resolvePackagedDataDirectories(packageRoot).map((directoryPath) =>
|
|
47
|
+
path.join(directoryPath, LEGACY_STATE_FILENAME)
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return candidates.find((candidatePath) => fs.existsSync(candidatePath)) ?? candidates[0];
|
|
40
51
|
}
|
|
41
52
|
|
|
42
53
|
function resolveHomebrewCellarInfo(packageRoot) {
|
|
@@ -83,23 +94,34 @@ function collectHomebrewLegacyStateDbPaths(packageRoot) {
|
|
|
83
94
|
return fs
|
|
84
95
|
.readdirSync(cellarInfo.cellarRoot, { withFileTypes: true })
|
|
85
96
|
.filter((entry) => entry.isDirectory() && entry.name !== cellarInfo.currentVersion)
|
|
86
|
-
.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
.flatMap((entry) =>
|
|
98
|
+
[
|
|
99
|
+
path.join(
|
|
100
|
+
cellarInfo.cellarRoot,
|
|
101
|
+
entry.name,
|
|
102
|
+
"libexec",
|
|
103
|
+
"lib",
|
|
104
|
+
"node_modules",
|
|
105
|
+
APP_NAME,
|
|
106
|
+
"server",
|
|
107
|
+
"data",
|
|
108
|
+
APP_STATE_DB_FILENAME
|
|
109
|
+
),
|
|
110
|
+
path.join(
|
|
111
|
+
cellarInfo.cellarRoot,
|
|
112
|
+
entry.name,
|
|
113
|
+
"libexec",
|
|
114
|
+
"lib",
|
|
115
|
+
"node_modules",
|
|
116
|
+
APP_NAME,
|
|
117
|
+
"data",
|
|
118
|
+
APP_STATE_DB_FILENAME
|
|
119
|
+
),
|
|
120
|
+
].map((candidatePath) => ({
|
|
99
121
|
path: candidatePath,
|
|
100
122
|
mtimeMs: safeStatMtimeMs(candidatePath),
|
|
101
|
-
}
|
|
102
|
-
|
|
123
|
+
}))
|
|
124
|
+
)
|
|
103
125
|
.filter((candidate) => candidate.mtimeMs >= 0)
|
|
104
126
|
.sort((left, right) => right.mtimeMs - left.mtimeMs)
|
|
105
127
|
.map((candidate) => candidate.path);
|
|
@@ -107,7 +129,9 @@ function collectHomebrewLegacyStateDbPaths(packageRoot) {
|
|
|
107
129
|
|
|
108
130
|
function collectLegacyDatabasePaths(packageRoot) {
|
|
109
131
|
return [
|
|
110
|
-
|
|
132
|
+
...resolvePackagedDataDirectories(packageRoot).map((directoryPath) =>
|
|
133
|
+
path.join(directoryPath, APP_STATE_DB_FILENAME)
|
|
134
|
+
),
|
|
111
135
|
...collectHomebrewLegacyStateDbPaths(packageRoot),
|
|
112
136
|
].filter((candidatePath, index, candidates) => candidates.indexOf(candidatePath) === index);
|
|
113
137
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|