Skip to main content

Module sqlite3py provides you very easy smart requests for sqlite database by Xpos587

Project description

sqlite3py

Module sqlite3py provides you very easy smart requests for sqlite database.

Read on GitHub
Examples folder

Methods:

  • set (Update (Set) values for selected row.)
  • insert (Insert (Push) row.)
  • all (Return all values.)
  • get (Return values from selected row.)
  • delete (Delete selected row.)

Example

'''After sqlite3py Version 2.0.0'''

from sqlite3py import Database

# Create database 
database = Database('./storage.db', check_same_thread = False)

# Create table
files = database.table('files')

# Set values
files.set('Documentation', {
    'title': 'Documentation',
    'description': 'Some description',
    'type': 'pdf',
    'uuid': 'a8098c1a-f86e-11da-bd1a-00112444be1e',
})

# Get values
files.get('Documentation')[0]['description']
# Return: 'Some description'

# Get all values
files.all()
# Return: [{'key': 'Documentation', 'value': {
#   'title': 'Documentation',
#   'description': 'Some description',
#   'type': 'pdf',
#   'uuid': 'a8098c1a-f86e-11da-bd1a-00112444be1e',
# }}]

Requirements Packages

  • sqlite3 (Already set by default)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlite3py-2.0.5.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page