https://github.com/rohit-chouhan/sqlite-snippet
Simple Easy MySQL + SQLite Snippet for Python.
https://github.com/rohit-chouhan/sqlite-snippet
database django flask flask-api python snippet sqlite3 vscode
Last synced: 3 months ago
JSON representation
Simple Easy MySQL + SQLite Snippet for Python.
- Host: GitHub
- URL: https://github.com/rohit-chouhan/sqlite-snippet
- Owner: rohit-chouhan
- License: mit
- Created: 2021-07-17T20:15:22.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-24T07:58:06.000Z (almost 5 years ago)
- Last Synced: 2025-03-09T13:13:21.855Z (over 1 year ago)
- Topics: database, django, flask, flask-api, python, snippet, sqlite3, vscode
- Homepage: https://marketplace.visualstudio.com/items?itemName=rohit-chouhan.sqlite-snippet
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Simple Easy MySQL + SQLite Snippet for Python, Developed by Rohit Chouhan
### For SQLite Connection
| Prefix |Description |
| ------------ | ------------ |
| sl-import | import sqlite3 |
| sl-createConnection, sl-createDb | create connection code |
### For MySQL Connection
| Prefix |Description |
| ------------ | ------------ |
| sql-import | import mysql.connector |
| sql-createConnection | create MySQL connection code |
| sql-createDBConnection | create MySQL connection with Database |
### For Both
| Prefix |Description |
| ------------ | ------------ |
| sl-select | retrive data code |
| sl-selectAll | retrive all data code |
| sl-insert | insert data code |
| sl-update | update data code |
| sl-updateAll | update all data code |
| sl-delete | delete data code |
| sl-deleteAll |delete all data code |
#### - Example
```python
#input
sl-select
#output
c = conn.cursor()
c.execute("SELECT * FROM table WHERE column='value'")
rows = c.fetchall()
for row in rows:
print(row)
```