Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 18, 2022. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

MiniSQL-Client

Cache region's address, send read-only request to region server and write statements to master server.

Warning

It is used for course assignment only, you may not use it in production environment~

As there is file operation, it may not use in a browser environment.

When you run it in Node.js, please make sure to set --experimental-specifier-resolution=node flag to ensure proper module resolution.

Usage

Note that all functions implemented in the package are asynchronous~

To create an instance of the client:

const client = await MiniSQLClient.create('xxx');

Where xxx is the master server's address.

To send commands, use

await client.queryRegion([tableName], [sql]);

or

await client.queryMaster([tableName], [sql]);

Note that the first one is for read-only queries, the second one is for write queries.