Skip to content

Commit 3edaa9d

Browse files
committed
testing workflow
1 parent 0907115 commit 3edaa9d

File tree

6 files changed

+69
-72
lines changed

6 files changed

+69
-72
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- master
6+
- psharma/update_readme
67
paths:
78
- 'website/**'
89
workflow_dispatch:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
slug: /contributing
3-
title: MySQL2
3+
title: SINGLESTORE-NODEJS
44
---
55

66
import { PageTitle } from '@site/src/components/PageTitle';
@@ -9,5 +9,5 @@ import { PageTitle } from '@site/src/components/PageTitle';
99

1010
# Contributing
1111

12-
Want to improve something in **MySQL2**?
13-
Please check [Contributing.md](https://github.com/sidorares/node-mysql2/blob/master/Contributing.md) for detailed instruction on how to get started.
12+
Want to improve something in **singlestore-nodejs**?
13+
Please check [Contributing.md](https://github.com/singlestore-labs/singlestore-nodejs/blob/master/Contributing.md) for detailed instruction on how to get started.

website/docs/contributing/website.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ You will need these tools installed on your system:
2323

2424
## Development
2525

26-
1. Fork the [MySQL2](https://github.com/sidorares/node-mysql2) repository.
27-
2. Download your forked repository locally. The website's workspace is the "_website_" directory in **node-mysql2** root.
26+
1. Fork the [SingleStore Node.js Driver](https://github.com/singlestore-labs/singlestore-nodejs) repository.
27+
2. Download your forked repository locally. The website's workspace is the "_website_" directory in **singlestore-nodejs** root.
2828
3. Create a new branch from `master` (optional).
2929
4. Run `cd website` to enter the website workspace.
30-
5. Run `npm ci` to install the dependecies from _package-lock.json_.
31-
6. Run `npm start` to starting the local development.
30+
5. Run `npm ci` to install the dependencies from _package-lock.json_.
31+
6. Run `npm start` to start the local development.
3232

3333
> It will start a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
3434
@@ -37,9 +37,9 @@ For **Docusaurus** complete documentation, please [see here](https://docusaurus.
3737
<FAQ title='CLI example'>
3838

3939
```bash
40-
git clone https://github.com/sidorares/node-mysql2.git
40+
git clone https://github.com/singlestore-labs/singlestore-nodejs.git
4141
git checkout -b website # optional
42-
cd /path-to/node-mysql2/website
42+
cd /path-to/singlestore-nodejs/website
4343
npm ci
4444
npm start
4545
```
@@ -55,7 +55,7 @@ Documentation is auto-generated from **MDX** files placed in these directories:
5555
:::danger Caution
5656
Note that the website has its own _package.json_.
5757

58-
Please, do not install dependencies for the website in **node-mysql2** root.
58+
Please, do not install dependencies for the website in **singlestore-nodejs** root.
5959
:::
6060

6161
<hr />
@@ -181,12 +181,12 @@ import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed';
181181

182182
<FAQ title='Example'>
183183
<ExternalCodeEmbed
184-
url='https://raw.githubusercontent.com/sidorares/node-mysql2/master/.prettierrc'
184+
url='https://raw.githubusercontent.com/singlestore-labs/singlestore-nodejs/master/.prettierrc'
185185
language='json'
186186
/>
187187

188188
<ExternalCodeEmbed
189-
url='https://raw.githubusercontent.com/sidorares/node-mysql2/master/tools/parse-row.js'
189+
url='https://raw.githubusercontent.com/singlestore-labs/singlestore-nodejs/master/tools/parse-row.js'
190190
language='js'
191191
extractMethod='parseC'
192192
methodType='function'

website/docs/documentation/00-index.mdx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { PageTitle } from '@site/src/components/PageTitle';
99

1010
# Documentation
1111

12-
[node-mysql]: https://github.com/mysqljs/mysql
12+
[node-mysql2]: https://github.com/sidorares/node-mysql2
1313

14-
MySQL2 aims to be a drop in replacement for [Node MySQL][node-mysql].
14+
**singlestore-nodejs** is a Node.js driver for SingleStoreDB, forked from [node-mysql2][node-mysql2]. It maintains compatibility with the MySQL protocol while providing optimized support for SingleStoreDB features.
1515

1616
:::note
17-
_If you see any API incompatibilities with [Node MySQL][node-mysql], please report via github issue._
17+
_This driver is based on [node-mysql2][node-mysql2] and maintains API compatibility. If you encounter any issues specific to SingleStoreDB, please report via GitHub issue._
1818
:::
1919

20-
Not only **MySQL2** offers better performance over [Node MySQL][node-mysql], we also support these additional features:
20+
**singlestore-nodejs** offers:
2121

2222
- [Prepared Statements](/docs/documentation/prepared-statements)
2323
- [Promise Wrapper](/docs/documentation/promise-wrapper)
@@ -33,7 +33,7 @@ Not only **MySQL2** offers better performance over [Node MySQL][node-mysql], we
3333

3434
## Examples
3535

36-
Please check these [examples](/docs/examples) for **MySQL2**.
36+
Please check these [examples](/docs/examples) for **singlestore-nodejs**.
3737

3838
<hr />
3939

@@ -66,17 +66,13 @@ This option could lose precision on the number as Javascript Number is a Float!
6666

6767
## Other Resources
6868

69-
- [Wire protocol documentation](https://dev.mysql.com/doc/internals/en/client-server-protocol.html)
70-
- [Node MySQL][node-mysql] - Most popular node.js mysql client library
71-
- [node-mariasql](https://github.com/mscdex/node-mariasql/) - Bindings to libmariasql. One of the fastest clients
72-
- [node-libmysqlclient](https://github.com/Sannis/node-mysql-libmysqlclient) - Bindings to libmysqlclient
73-
- [go-mysql](https://github.com/siddontang/go-mysql) - MySQL Go client (prepared statements, binlog protocol, server)
69+
- [SingleStoreDB Documentation](https://docs.singlestore.com/)
70+
- [MySQL Wire Protocol Documentation](https://dev.mysql.com/doc/internals/en/client-server-protocol.html)
71+
- [node-mysql2][node-mysql2] - The upstream MySQL client library this driver is based on
7472

7573
<hr />
7674

7775
## Benchmarks
7876

79-
- https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b
8077
- `npm run benchmarks`
81-
- [node-mysql-benchmarks](https://github.com/mscdex/node-mysql-benchmarks)
82-
- try to run example [benchmarks](https://github.com/sidorares/node-mysql2/tree/master/benchmarks) on your system
78+
- try to run example [benchmarks](https://github.com/singlestore-labs/singlestore-nodejs/tree/master/benchmarks) on your system

website/docs/index.mdx

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
slug: /
33
position: 1
44
title: Quickstart
5-
description: MySQL client for Node.js with focus on performance
5+
description: SingleStore client for Node.js with focus on performance
66
---
77

88
import Tabs from '@theme/Tabs';
@@ -11,19 +11,19 @@ import { PageTitle } from '@site/src/components/PageTitle';
1111

1212
<PageTitle title='SingleStore-Nodejs | Quickstart' />
1313

14-
[npm-image]: https://img.shields.io/npm/v/mysql2.svg
15-
[npm-url]: https://npmjs.org/package/mysql2
16-
[node-version-image]: https://img.shields.io/node/v/mysql2.svg
14+
[npm-image]: https://img.shields.io/npm/v/singlestore-nodejs.svg
15+
[npm-url]: https://npmjs.org/package/singlestore-nodejs
16+
[node-version-image]: https://img.shields.io/node/v/singlestore-nodejs.svg
1717
[node-version-url]: https://nodejs.org/download/
18-
[downloads-image]: https://img.shields.io/npm/dm/mysql2.svg
19-
[downloads-url]: https://npmjs.org/package/mysql2
20-
[license-url]: https://github.com/sidorares/node-mysql2/blob/master/License
21-
[license-image]: https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000
18+
[downloads-image]: https://img.shields.io/npm/dm/singlestore-nodejs.svg
19+
[downloads-url]: https://npmjs.org/package/singlestore-nodejs
20+
[license-url]: https://github.com/singlestore-labs/singlestore-nodejs/blob/master/License
21+
[license-image]: https://img.shields.io/npm/l/singlestore-nodejs.svg?maxAge=2592000
2222
[node-mysql]: https://github.com/mysqljs/mysql
23-
[coverage]: https://img.shields.io/codecov/c/github/sidorares/node-mysql2
24-
[coverage-url]: https://app.codecov.io/github/sidorares/node-mysql2
25-
[ci-url]: https://github.com/sidorares/node-mysql2/actions/workflows/ci-coverage.yml?query=branch%3Amaster
26-
[ci-image]: https://img.shields.io/github/actions/workflow/status/sidorares/node-mysql2/ci-coverage.yml?event=push&style=flat&label=CI&branch=master
23+
[coverage]: https://img.shields.io/codecov/c/github/singlestore-labs/singlestore-nodejs
24+
[coverage-url]: https://app.codecov.io/github/singlestore-labs/singlestore-nodejs
25+
[ci-url]: https://github.com/singlestore-labs/singlestore-nodejs/actions/workflows/ci-coverage.yml?query=branch%3Amaster
26+
[ci-image]: https://img.shields.io/github/actions/workflow/status/singlestore-labs/singlestore-nodejs/ci-coverage.yml?event=push&style=flat&label=CI&branch=master
2727

2828
# SingleStore-Nodejs
2929

@@ -40,20 +40,20 @@ SingleStore client for Node.js with focus on performance. Supports prepared stat
4040

4141
## Installation
4242

43-
MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues.
43+
SingleStore-Nodejs is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues.
4444

4545
<Tabs>
4646
<TabItem value='JavaScript' default>
4747

4848
```bash
49-
npm install --save mysql2
49+
npm install --save singlestore-nodejs
5050
```
5151

5252
</TabItem>
5353
<TabItem value='TypeScript'>
5454

5555
```bash
56-
npm install --save mysql2
56+
npm install --save singlestore-nodejs
5757
npm install --save-dev @types/node
5858
```
5959

@@ -73,10 +73,10 @@ npm install --save-dev @types/node
7373

7474
```js
7575
// Get the client
76-
import mysql from 'mysql2/promise';
76+
import singlestore from 'singlestore-nodejs/promise';
7777

7878
// Create the connection to database
79-
const connection = await mysql.createConnection({
79+
const connection = await singlestore.createConnection({
8080
host: 'localhost',
8181
user: 'root',
8282
database: 'test',
@@ -112,10 +112,10 @@ try {
112112

113113
```js
114114
// Get the client
115-
const mysql = require('mysql2');
115+
const singlestore = require('singlestore-nodejs');
116116

117117
// Create the connection to database
118-
const connection = mysql.createConnection({
118+
const connection = singlestore.createConnection({
119119
host: 'localhost',
120120
user: 'root',
121121
database: 'test',
@@ -147,23 +147,23 @@ connection.query(
147147

148148
### Using Prepared Statements
149149

150-
With MySQL2 you also get the prepared statements. With prepared statements MySQL doesn't have to prepare plan for same query every time, this results in better performance. If you don't know why they are important, please check these discussions:
150+
With SingleStore-Nodejs you also get the prepared statements. With prepared statements SingleStore doesn't have to prepare plan for same query every time, this results in better performance. If you don't know why they are important, please check these discussions:
151151

152152
- [How prepared statements can protect from SQL Injection attacks](https://stackoverflow.com/questions/8263371/how-can-prepared-statements-protect-from-sql-injection-attacks)
153153

154-
MySQL2 provides `execute` helper which will prepare and query the statement. You can also manually prepare / unprepare statement with `prepare` / `unprepare` methods.
154+
SingleStore-Nodejs provides `execute` helper which will prepare and query the statement. You can also manually prepare / unprepare statement with `prepare` / `unprepare` methods.
155155

156156
> To explore more Prepared Statements and Placeholders examples, please visit the example section [**Prepared Statements**](/docs/examples/queries/prepared-statements).
157157
158158
<Tabs>
159159
<TabItem value='Promise' default>
160160

161161
```js
162-
import mysql from 'mysql2/promise';
162+
import singlestore from 'singlestore-nodejs/promise';
163163

164164
try {
165165
// create the connection to database
166-
const connection = await mysql.createConnection({
166+
const connection = await singlestore.createConnection({
167167
host: 'localhost',
168168
user: 'root',
169169
database: 'test',
@@ -186,10 +186,10 @@ try {
186186
<TabItem value='Callback'>
187187

188188
```js
189-
const mysql = require('mysql2');
189+
const singlestore = require('singlestore-nodejs');
190190

191191
// create the connection to database
192-
const connection = mysql.createConnection({
192+
const connection = singlestore.createConnection({
193193
host: 'localhost',
194194
user: 'root',
195195
database: 'test',
@@ -217,7 +217,7 @@ If you execute same statement again, it will be picked from a LRU cache which wi
217217

218218
### Using Connection Pools
219219

220-
Connection pools help reduce the time spent connecting to the MySQL server by reusing a previous connection, leaving them open instead of closing when you are done with them.
220+
Connection pools help reduce the time spent connecting to the SingleStore server by reusing a previous connection, leaving them open instead of closing when you are done with them.
221221

222222
This improves the latency of queries as you avoid all of the overhead that comes with establishing a new connection.
223223

@@ -227,10 +227,10 @@ This improves the latency of queries as you avoid all of the overhead that comes
227227
<TabItem value='Promise' default>
228228

229229
```js
230-
import mysql from 'mysql2/promise';
230+
import singlestore from 'singlestore-nodejs/promise';
231231

232232
// Create the connection pool. The pool-specific settings are the defaults
233-
const pool = mysql.createPool({
233+
const pool = singlestore.createPool({
234234
host: 'localhost',
235235
user: 'root',
236236
database: 'test',
@@ -248,10 +248,10 @@ const pool = mysql.createPool({
248248
<TabItem value='Callback'>
249249

250250
```js
251-
const mysql = require('mysql2');
251+
const singlestore = require('singlestore-nodejs');
252252

253253
// Create the connection pool. The pool-specific settings are the defaults
254-
const pool = mysql.createPool({
254+
const pool = singlestore.createPool({
255255
host: 'localhost',
256256
user: 'root',
257257
database: 'test',
@@ -345,14 +345,14 @@ conn.release();
345345

346346
### Using Promise Wrapper
347347

348-
MySQL2 also support Promise API. Which works very well with ES7 async await.
348+
SingleStore-Nodejs also support Promise API. Which works very well with ES7 async await.
349349

350350
```js
351-
import mysql from 'mysql2/promise';
351+
import singlestore from 'singlestore-nodejs/promise';
352352

353353
async function main() {
354354
// create the connection
355-
const connection = await mysql.createConnection({
355+
const connection = await singlestore.createConnection({
356356
host: 'localhost',
357357
user: 'root',
358358
database: 'test',
@@ -366,17 +366,17 @@ async function main() {
366366
}
367367
```
368368

369-
MySQL2 use default `Promise` object available in scope. But you can choose which `Promise` implementation you want to use.
369+
SingleStore-Nodejs use default `Promise` object available in scope. But you can choose which `Promise` implementation you want to use.
370370

371371
```js
372372
// get the client
373-
import mysql from 'mysql2/promise';
373+
import singlestore from 'singlestore-nodejs/promise';
374374

375375
// get the promise implementation, we will use bluebird
376376
import bluebird from 'bluebird';
377377

378378
// create the connection, specify bluebird as Promise
379-
const connection = await mysql.createConnection({
379+
const connection = await singlestore.createConnection({
380380
host: 'localhost',
381381
user: 'root',
382382
database: 'test',
@@ -390,14 +390,14 @@ const [rows, fields] = await connection.execute(
390390
);
391391
```
392392

393-
MySQL2 also exposes a `.promise()` function on Pools, so you can create a promise/non-promise connections from the same pool.
393+
SingleStore-Nodejs also exposes a `.promise()` function on Pools, so you can create a promise/non-promise connections from the same pool.
394394

395395
```js
396-
import mysql from 'mysql2';
396+
import singlestore from 'singlestore-nodejs';
397397

398398
async function main() {
399399
// create the pool
400-
const pool = mysql.createPool({
400+
const pool = singlestore.createPool({
401401
host: 'localhost',
402402
user: 'root',
403403
database: 'test',
@@ -411,13 +411,13 @@ async function main() {
411411
}
412412
```
413413

414-
MySQL2 exposes a `.promise()` function on Connections, to "upgrade" an existing non-promise connection to use promise.
414+
SingleStore-Nodejs exposes a `.promise()` function on Connections, to "upgrade" an existing non-promise connection to use promise.
415415

416416
```js {11}
417-
const mysql = require('mysql2');
417+
const singlestore = require('singlestore-nodejs');
418418

419419
// create the connection
420-
const conn = mysql.createConnection({
420+
const conn = singlestore.createConnection({
421421
host: 'localhost',
422422
user: 'root',
423423
database: 'test',
@@ -449,7 +449,7 @@ You can enable this setting at either the connection level (applies to all queri
449449
<TabItem value='Promise' default>
450450

451451
```js {5}
452-
const conn = await mysql.createConnection({
452+
const conn = await singlestore.createConnection({
453453
host: 'localhost',
454454
database: 'test',
455455
user: 'root',
@@ -461,7 +461,7 @@ const conn = await mysql.createConnection({
461461
<TabItem value='Callback'>
462462

463463
```js {5}
464-
const conn = mysql.createConnection({
464+
const conn = singlestore.createConnection({
465465
host: 'localhost',
466466
database: 'test',
467467
user: 'root',
@@ -513,6 +513,6 @@ conn.query(
513513
<hr />
514514

515515
:::tip Getting Help
516-
Need help? Ask your question on [Stack Overflow](https://stackoverflow.com/questions/tagged/mysql2) or [GitHub](https://github.com/sidorares/node-mysql2/discussions).
517-
If you've encountered an issue, please [file it on GitHub](https://github.com/sidorares/node-mysql2/issues).
516+
Need help? Ask your question on [Stack Overflow](https://stackoverflow.com/questions/tagged/singlestore-nodejs) or [GitHub](https://github.com/singlestore-labs/singlestore-nodejs/discussions).
517+
If you've encountered an issue, please [file it on GitHub](https://github.com/singlestore-labs/singlestore-nodejs/issues).
518518
:::

0 commit comments

Comments
 (0)