一个简单的数据库系统
sunlite的Python项目详细描述
#太阳岩
Sunlite简单数据库系统
[*Jump to sunlite database server]
简单、快速、本地、用户友好
速度菜单
对于Sunlite数据库
[*Jump to sunlite database connection]
[*Jump to sunlite database tutorials]
[*Jump to sunlite database examples]
对于Sunlite服务器数据库
[*Jump to sunlite database server Q/A]
[*Jump to sunlite database server getting started]
[*Jump to sunlite database server how to links]
什么是太阳石?
ans:sunlite是一个用于简单数据管理的模块。
- 如何使用
- 连接到内存。
- 连接到数据库。
- 创建新标题。 >;gt;
- 添加数据或拉取数据 >;gt;
- 享受^ ^
- 连接到内存。
连接
Sunlite lets you connect as you want.
^{pr 1}$Generating new header
headers are like boxes which contains your datas , don't forget to make one before pushing or pulling data
^{pr 2}$Pushing data to headers
by pushing , we add data in headers to contain . you can push any data .
^{pr 3}$Pullling data from headers
you can pull all data of header or an invidual data
^{pr 4}$don't use same names for two datas as it will remove 2nd one .
Get a header as you want. This time duplicate names are accepted.
unlike pull function , this function doesn't update duplicate datas as sends as they are .
this is useful in maintaining a large set of same data.
^{pr 5}$Beauty print .
You can beauty print all data's in all headers .
^{pr 6}$Get all headers
^{pr 7}$Example with a user info system with sunlite
^{pr 8}$Sunlite Server
Sunlite server is a database server which can be generated in memory or in a physical database .
Why and How ?
^{bq 3}$I think i am ready for my first server :)
To start a server of your existing sunlite database ( tutorials above about using sunlite database system ) , simply login to your python console installed and execute from sunlite.server import Serve
^{pr 9}$So to connect a sunlite database with the name 'test' and save it's logs in a folder named logs in the project directory , just do
^{pr 10}$and your server will start running in http://localhost:5000
要禁用或无法日志,可以在服务内部使用logs=True
或logs=False
。
例如,用于关闭日志
fromsunlite.serverimportServeServe(name="test",logs=False,logfolder="logs").invoke()
默认情况下会打开日志。
要打开首选IP地址上的服务器,
fromsunlite.serverimportServeServe(name="test",logs=False,logfolder="logs").invoke(ip='your ip',port=your_port)#example Serve(name="test" , logs=False , logfolder="logs").invoke(ip='127.0.0.1' , port = 5000)
Links to send database requests.
to get all data in your database
http://[your-ip]:[your-port]/a/
to get header list
http://[your-ip]:[your-port]/h/
to create a new header
http://[your-ip]:[your-port]/new/[header-name]
to pull a data
http://[your-ip]:[your-port]/p/[data-name]
to get total data of a header
http://[your-ip]:[your-port]/g/[header-name]
to add a data or modify in a header
http://[your-ip]:[your-port]/add/[data-name]/[data]/[header-name]
do remember html link syntaxes.
ex.
http://127.0.0.1:5000/p/hello将提取名为hello的数据 http://127.0.0.1:5000/g/myheader将从头myheader etc中提取数据
重要
用%20f格式化空格
例如,如果您的数据名是my data 使链接像http://127.0.0.1:5000/p/my%f20data 不是http://127.0.0.1:5000/p/my数据