rozenite-sqlite 0.0.2 → 0.0.6

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/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # rozenite-sqlite
2
+
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - test workflow
8
+
9
+ ## 0.0.5
10
+
11
+ ### Patch Changes
12
+
13
+ - update workflow
14
+
15
+ ## 0.0.4
16
+
17
+ ### Patch Changes
18
+
19
+ - add release action
20
+
21
+ ## 0.0.3
22
+
23
+ ### Patch Changes
24
+
25
+ - add workflow and readme
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # rozenite-sqlite
2
+
3
+ A [Rozenite](https://rozenite.dev) devtools plugin that adds a live SQLite explorer panel to your React Native app. Browse your databases, inspect tables, run arbitrary SQL queries, and view row details — all from the Rozenite devtools panel without leaving your development workflow.
4
+
5
+ ## Requirements
6
+
7
+ - React Native app using [Rozenite devtools](https://rozenite.dev)
8
+ - A SQLite library (e.g. [`expo-sqlite`](https://docs.expo.dev/versions/latest/sdk/sqlite/), [`op-sqlite`](https://github.com/OP-Engineering/op-sqlite), [`react-native-quick-sqlite`](https://github.com/margelo/react-native-quick-sqlite)) — any library works as long as you can execute raw SQL queries
9
+
10
+ ## Installation
11
+
12
+ ```sh
13
+ npm install rozenite-sqlite
14
+ ```
15
+
16
+ Make sure you also have the Rozenite devtools set up in your project. Refer to the [Rozenite docs](https://rozenite.dev/docs) for the initial setup.
17
+
18
+ ## Usage
19
+
20
+ Call `useRozeniteSQLite` once near the root of your app (or in the component that holds your database instances). The hook handles all communication with the devtools panel — you don't interact with the plugin bridge directly.
21
+
22
+ ```tsx
23
+ import { useRozeniteSQLite } from 'rozenite-sqlite/react-native';
24
+
25
+ export default function App() {
26
+ useRozeniteSQLite({
27
+ databases: ['app.db', 'cache.db'],
28
+ sqlExecutor: async (dbName, query) => {
29
+ const db = myDatabases[dbName];
30
+ return db.getAllAsync(query);
31
+ },
32
+ });
33
+
34
+ // ... rest of your app
35
+ }
36
+ ```
37
+
38
+ ### With expo-sqlite
39
+
40
+ ```tsx
41
+ import { useEffect, useState } from 'react';
42
+ import * as SQLite from 'expo-sqlite';
43
+ import { useRozeniteSQLite } from 'rozenite-sqlite/react-native';
44
+
45
+ export default function App() {
46
+ const [databases, setDatabases] = useState<Record<string, SQLite.SQLiteDatabase>>({});
47
+
48
+ useEffect(() => {
49
+ const setup = async () => {
50
+ const app = await SQLite.openDatabaseAsync('app.db');
51
+ const cache = await SQLite.openDatabaseAsync('cache.db');
52
+ setDatabases({ app, cache });
53
+ };
54
+ setup();
55
+ }, []);
56
+
57
+ useRozeniteSQLite({
58
+ databases: Object.keys(databases).map((key) => `${key}.db`),
59
+ sqlExecutor: async (dbName, query) => {
60
+ const key = dbName.replace(/\.db$/, '');
61
+ const db = databases[key];
62
+ if (!db) throw new Error(`Database "${dbName}" not found`);
63
+ return db.getAllAsync(query) as Promise<Record<string, unknown>[]>;
64
+ },
65
+ });
66
+
67
+ // ...
68
+ }
69
+ ```
70
+
71
+ ### With op-sqlite
72
+
73
+ ```tsx
74
+ import { open } from '@op-engineering/op-sqlite';
75
+ import { useRozeniteSQLite } from 'rozenite-sqlite/react-native';
76
+
77
+ const db = open({ name: 'app.db' });
78
+
79
+ export default function App() {
80
+ useRozeniteSQLite({
81
+ databases: ['app.db'],
82
+ sqlExecutor: async (_dbName, query) => {
83
+ const result = db.execute(query);
84
+ return result.rows?._array ?? [];
85
+ },
86
+ });
87
+
88
+ // ...
89
+ }
90
+ ```
91
+
92
+ ## API
93
+
94
+ ### `useRozeniteSQLite(config)`
95
+
96
+ A React hook that connects your app to the Rozenite SQLite devtools panel.
97
+
98
+ | Parameter | Type | Description |
99
+ |-----------|------|-------------|
100
+ | `config.databases` | `string[]` | List of database names exposed to the panel, e.g. `["app.db", "cache.db"]` |
101
+ | `config.sqlExecutor` | `(dbName: string, query: string) => Promise<Record<string, unknown>[]>` | Library-agnostic SQL runner — receives the database name and a raw SQL query, returns an array of row objects |
102
+
103
+ The hook has no return value. It registers message handlers for the devtools panel and cleans them up automatically when the component unmounts or when the client reconnects.
104
+
105
+ ## Devtools Panel Features
106
+
107
+ Once connected, the Rozenite SQLite panel provides:
108
+
109
+ - **Database switcher** — select from all registered databases
110
+ - **Table browser** — list all user tables in the selected database
111
+ - **Data grid** — paginated view of rows with column headers
112
+ - **Row detail panel** — inspect all fields of a selected row
113
+ - **SQL console** — run arbitrary `SELECT` (or any) queries against the selected database
114
+ - **Refresh** — reload the current table data on demand
115
+
116
+ ## License
117
+
118
+ MIT
@@ -1 +1 @@
1
- {"name":"rozenite-sqlite","version":"0.0.1","description":"SQLite explorer for RN devtools","panels":[{"name":"SQLite","source":"/panel.html"}]}
1
+ {"name":"rozenite-sqlite","version":"0.0.6","description":"SQLite explorer for RN devtools","panels":[{"name":"SQLite","source":"/panel.html"}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rozenite-sqlite",
3
- "version": "0.0.2",
3
+ "version": "0.0.6",
4
4
  "description": "SQLite explorer for RN devtools",
5
5
  "type": "module",
6
6
  "main": "./dist/react-native.js",
@@ -14,17 +14,21 @@
14
14
  "@rozenite/plugin-bridge": "1.0.0-alpha.3"
15
15
  },
16
16
  "devDependencies": {
17
+ "vite": "^6.0.0",
17
18
  "@rozenite/vite-plugin": "1.0.0-alpha.3",
18
- "@types/react": "~18.3.12",
19
- "react-native": "0.76.0",
20
- "react-native-web": "0.21.0",
21
- "rozenite": "1.0.0-alpha.3",
22
19
  "typescript": "^5.7.3",
23
- "vite": "^6.0.0"
20
+ "rozenite": "1.0.0-alpha.3",
21
+ "react-native-web": "0.21.0",
22
+ "react-native": "0.76.0",
23
+ "@types/react": "~18.3.12"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "*",
27
27
  "react-native": "*"
28
28
  },
29
- "license": "MIT"
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/groot007/rozenite-sqlite-plugin"
33
+ }
30
34
  }