![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
SQLink is a Node.js library that turns MySQL tables into RESTful APIs with procedure execution and full CRUD support.
SQLink is a Node.js library that turns MySQL tables into RESTful APIs with procedure execution and full CRUD (Create, Read, Update, Delete) support. With SQLink, you can easily expose your MySQL tables and stored procedures as APIs, allowing seamless interaction with your database through HTTP requests.
Before using SQLink, ensure that you have npm installed on your machine. You can install SQLink globally using the following commands:
sudo npm install -g sqlink
npm install -g sqlink
Before querying data from MySQL, you need to configure SQLink. To do this, run the following command:
sqlink run
After running this command, you will be prompted in the console to enter your MySQL credentials.
Important: Configuration is required only when you run the program for the first time or if the configuration file has been deleted.
Once you enter the MySQL and Server configuration, you can re-run sqlink run
command again and start querying the data.
SQLink allows you to interact with your MySQL tables using RESTful endpoints.
Base URL:
https://localhost:3001/table/{tableName}/{mode}
tableName
: The name of the MySQL table you want to query.mode
: The operation you want to perform. It can be one of the following: create
, read
, update
, delete
.Use this method to insert data into your MySQL table.
https://localhost:3001/table/{tableName}/create
POST
{
"column1": "value1",
"column2": "value2"
}
200 OK
if inserted successfully.Use this method to retrieve data from your MySQL table.
https://localhost:3001/table/{tableName}/read
GET
200 OK
if queried successfully.Use this method to update data in your MySQL table.
https://localhost:3001/table/{tableName}/update({updateKey},{updateValue})
PUT
{
"column1": "value1_updated",
"column2": "value2_updated"
}
200 OK
if updated successfully.Use this method to delete a record from your MySQL table.
https://localhost:3001/table/{tableName}/delete({deleteKey},{deleteValue})
DELETE
{
// Payload is not considered even if sent from the client
}
200 OK
if deleted successfully.SQLink also supports executing stored procedures through API calls.
Base URL:
https://localhost:3001/procedure/{procedureName}
https://localhost:3001/procedure/topfiveusers()
Or with arguments:
https://localhost:3001/procedure/topfiveusers('MALE')
GET
200 OK
if executed successfully.Contributions are welcome! Please submit a pull request or open an issue to discuss potential improvements or new features.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
SQLink is a Node.js library that turns MySQL tables into RESTful APIs with procedure execution and full CRUD support.
The npm package sqlink receives a total of 3 weekly downloads. As such, sqlink popularity was classified as not popular.
We found that sqlink demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.