Skip to main content

A lightweight and powerful SQL database implementation

Project description

LikOb

一个用Python实现的简单关系型数据库(当然,它会变得越来越不简单!),用于学习数据库原理。

功能特性

  • 基本的SQL语句支持(CREATE, SELECT, INSERT, DELETE)
  • 条件查询(WHERE)
  • 数据持久化
  • 表格化输出
  • 类型检查

安装

pip install likob

如果无法安装,可能是版本冲突问题,可以安装具体的版本

pip install likob==0.1.2

源码下载

git clone https://github.com/lik639259/LikOb.git
cd LikOb

源码使用方法

作为包导入你的代码

import likob

创建数据库实例

db = likob.create_database()

执行SQL语句

db.execute("CREATE TABLE users (id INT PRIMARY KEY, name TEXT NOT NULL)")
db.execute("INSERT INTO users VALUES (1, 'Alice')")
result = db.execute("SELECT * FROM users")
print(result)

启动shell程序

如果你已经安装了likob

likob

或者运行根目录下的main.py文件

python main.py

启动后可以看到这样的界面

Welcome to LikOb Database Shell. Type help or ? to list commands.
LikOb> 

注意事项

  1. 这并不是LikOb的最终版本,事实上这个项目还有很多的优化空间,后续会随缘更新,添加新功能或优化代码性能
  2. 本项目完全开源,请随意下载并使用它
  3. 本项目只是一个mini数据库,其性能远逊于MySQL、sqlite等传统数据库,不适合用于大型开发或生产环境,更多的是用于数据库初学者进行交流学习,本项目使用python编写,各个文件、函数的功能简单易懂,且标有详细的注释,对初学者是相当友好的
  4. 作者只是一名卑微的本科生(ㄒoㄒ),所以这个数据库很难做到十全十美,欢迎(也恳求)大家的issue和pr。当然,只要能获得大家的star我就很满意了

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

likob-1.0.3.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

likob-1.0.3-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file likob-1.0.3.tar.gz.

File metadata

  • Download URL: likob-1.0.3.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for likob-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ffc6403cd7680edb0491cef81c288beda35f9a4576bebbf4f6626cb29361eef1
MD5 85c47af01797035c9011c40adddf3026
BLAKE2b-256 5d0f4d6ba207ce403262e70778f5e6f2533834983d0813a7f0a1185bed82c8cd

See more details on using hashes here.

File details

Details for the file likob-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: likob-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for likob-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 69d426433af3eb6ce110333e498112011aedbd76b3bdd266f81557b58dcbdfaa
MD5 0a63a5a3ac41a37bbcace832f5e64cd7
BLAKE2b-256 7d7dcc709bc6ccf0255b2d36f521debbfcb0bc679315a37bd374f9888d0173a8

See more details on using hashes here.

Supported by

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