Socket
Socket
Sign inDemoInstall

sqlite3cm

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqlite3cm

Context manager for Sqlite databases


Maintainers
1

SQLITE3 CM


SQLITE 3 CM is a context manager, 😃 A way TO USE with statement on sqlite databases !! (WITHOUT CLOSING OR OPENING ANYTING 🤩)

Install 📦

pip install sqlite3cm

Docs 📄


from sqlite3cm import OpenSqlite3db

with OpenSqlite3db("database.db", throw_error=True) as (conn, cursor):
    conn.execute('CREATE TABLE IF NOT EXISTS users')

Note:

You shouldn't forget about the parentisis after the as

Arguments


db_path Path to the database (can be Pathlib path) (default to "database.db")

throw_error Weather you want to throw an error or not (default to True)

Note:

None of these arguments are required.

Lightness 🕊


THE SCRIPT IS ONLY 20 LINES LONG 😄 (50 with docstrings and comments)

Features 🧪


At the beggining, the script will connect to the database and create a cursor

At the end, the script will commit, close the connection and cursor

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc