1.1.0 • Published 2 years ago
@enzymii/minisql-client v1.1.0
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.