You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add Vite section and example apps table to README
Adds guidance for using msnodesqlv8 with Vite (mark as external or
keep imports server-side only) and consolidates the example apps
table from release notes into the README.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,6 +154,33 @@ If you are using Webpack for your application, you need to:
154
154
}
155
155
```
156
156
157
+
### Vite
158
+
159
+
Since `msnodesqlv8` is a native Node.js addon, it cannot be bundled by Vite. The solution is to only import it in server-side code (e.g. Express API routes) and have the frontend communicate via `fetch`. See the [Vite example app](https://github.com/TimelordUK/msnodesqlv8-vite) for a complete working setup.
160
+
161
+
If you are using Vite SSR and need to import the module in SSR code that Vite processes, mark it as external in your `vite.config.ts`:
162
+
163
+
```ts
164
+
exportdefaultdefineConfig({
165
+
ssr: {
166
+
external: ['msnodesqlv8']
167
+
}
168
+
})
169
+
```
170
+
171
+
### Example Apps
172
+
173
+
| description | link |
174
+
|---|---|
175
+
| next js example, note cant run driver on UI thread. |[todo-with-nextjs_msnodesqlv8](https://github.com/TimelordUK/todo-with-nextjs_msnodesqlv8)|
176
+
| using vite + express |[msnodesqlv8-vite](https://github.com/TimelordUK/msnodesqlv8-vite)|
177
+
| using in typescript |[msnodesqlv8_ts_sample](https://github.com/TimelordUK/msnodesqlv8_ts_sample)|
178
+
| js example typings in IDE |[msnodesqlv8_yarn_sample](https://github.com/TimelordUK/msnodesqlv8_yarn_sample)|
179
+
| using sequelize |[msnodesqlv8-sequelize](https://github.com/TimelordUK/msnodesqlv8-sequelize)|
180
+
| using mssql |[msnodesqlv8_mssql_sample](https://github.com/TimelordUK/msnodesqlv8_mssql_sample)|
181
+
| using electron |[msnodesqlv8-electron](https://github.com/TimelordUK/msnodesqlv8-electron)|
182
+
| using react |[msnodesqlv8-react](https://github.com/TimelordUK/msnodesqlv8-react)|
183
+
157
184
### Pool
158
185
159
186
you can now submit queries through a native library connection pool. This pool creates a set of connections and queues work submitting items such that all connections are busy providing work exists. A keep alive is sent periodically to check connection integrity and idle connections beyond a threshold are closed and re-created when queries submitted at a later point in time. Queries can be cancelled and paused / resumed regardless of where they are in the work lifecycle
0 commit comments