Skip to content

Commit 711dfed

Browse files
TimelordUKclaude
andcommitted
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>
1 parent 9bf417f commit 711dfed

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,33 @@ If you are using Webpack for your application, you need to:
154154
}
155155
```
156156

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+
export default defineConfig({
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+
157184
### Pool
158185

159186
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

Comments
 (0)