Attention: The code in this repository is intended for experimental use only and is not fully tested, documented, or supported by SingleStore. Visit the SingleStore Forums to ask questions about this repository.
Whether you're using an ORM or straight SQL, you can get started with SingleStore (formerly MemSQL) fast. Here's an introductory sample of using SingleStore with Node and JavaScript. This sample includes all the CRUD methods: Create, Read by id, Read all, Update, and Delete.
This is the demo code to accompany this blog post: How to Use SingleStore and Node.
- Node.js (version 14 or later)
- Before you begin, you will need a FREE SingleStore account. You can learn more about creating an SingleStore account in the SingleStore Getting Started documentation.
git clone git@github.com:singlestore-labs/key-value-store-demo.git
cd key-value-store-demo
npm install
In index.js
be sure to change the connection details at the top of the file to match the connection details from your SingleStore Database
// index.js
// TODO: adjust these connection details to match your SingleStore deployment:
const HOST = 'PASTE YOUR SINGLESTORE ADMIN ENDPOINT HERE';
const USER = 'admin';
const PASSWORD = 'PASTE YOUR PASSWORD HERE';
const DATABASE = "app";
npm start
To learn more about SingleStore, take a look at the following resources:
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Joe Karlsson |