Socket
Socket
Sign inDemoInstall

sqlitetable

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqlitetable

Use sqlite just like classes!


Maintainers
1

SqliteTable

Use sqlite just like classes!

Create Table

from sqlitetable import SqliteTable
class Student(SqliteTable):
    uid:int
    name:str
Student.create_table('test.db')

The above code creates the following table

CREATE TABLE "student"(
    "uid" INTEGER,
    "name" TEXT
);

Simple Insert

s = Student()
s.uid = 10001
s.name = 'Hu Tao'
s.sqlite_insert()

The above code runs

INSERT INTO "student" ("uid", "name") VALUES (10001, 'Hu Tao');

Simple Select

s = Student()
s.name = 'Hu Tao'
for e in s.sqlite_select():
    print(e, e.uid, e.name)

The above code runs

SELECT "uid" FROM "student" WHERE "name"='Hu Tao';

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc