This repository will walk you through the process of quickly getting started with Node.js and MariaDB using the MariaDB Python connector.
This sample requires the following to be installed/enabled on your machine:
- Python (v. 3+)
- MariaDB Connector/C (v. 3.1.5+) (used by Connector/Python, find more information here)
To run the sample code in this repository you'll first need to install the MariaDB Python connector (driver).
Once you've installed the MariaDB Python connector you're ready to run the tasks.py sample.
The tasks.py sample can be used to:
-
Create
a database and table (necessary for the subsequent CRUD operations).$ python3 src/tasks.py create
-
Drop
the database (and table).$ python3 src/tasks.py drop
-
Insert
a new tasks record.$ python3 src/tasks.py add 'New Task Description'
-
Update
a task record's completion field (by specifying theid
andcompletion
value).$ python3 src/tasks.py updateStatus 3 1
-
Select
and print all tasks.$ python3 src/tasks.py show
-
Delete
a task record (byid
).$ python3 src/tasks.py delete 3
- How to connect Python programs to MariaDB (blog)
- Official MariaDB Documentation
- MariaDB Quickstart Guide
Please feel free to submit PR's, issues or requests to this project directly.
If you have any other questions, comments, or looking for more information on MariaDB please check out:
Or reach out to us directly via: