欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

純Python開發的nosql數據庫CodernityDB介紹和使用實例

系統 1647 0

看看這個logo,有些像python的小蛇吧 。這次介紹的數據庫codernityDB是純python開發的。

純Python開發的nosql數據庫CodernityDB介紹和使用實例_第1張圖片

先前用了下tinyDB這個本地數據庫,也在一個api服務中用了下,一開始覺得速度有些不給力,結果一看實現的方式,真是太鳥了,居然就是json的存儲,連個二進制壓縮都沒有。? 這里介紹的CodernityDB 也是純開發的一個小數據庫。

CodernityDB是開源的,純Python語言(沒有第三方依賴),快速,多平臺的NoSQL型數據庫。它有可選項支持HTTP服務版本(CodernityDB-HTTP),和Python客戶端庫(CodernityDB-PyClient),它目標是100%兼容嵌入式的版本。

主要特點

1.Pyhon原生支持
2.多個索引
3.快(每秒可達50 000次insert操作)
4.內嵌模式(默認)和服務器模式(CodernityDB-HTTP),加上客戶端庫(CodernityDB-PyClient),能夠100%兼容
5.輕松完成客戶的存儲

CodernityDB數據庫操作代碼實例:

復制代碼 代碼如下:

Insert(simple)
?
from CodernityDB.database import Database
?
db = Database('/tmp/tut1')
db.create()
?
insertDict = {'x': 1}
print db.insert(insertDict)
?
?

?
Insert
?
from CodernityDB.database import Database
from CodernityDB.hash_index import HashIndex
?
class WithXIndex(HashIndex):
??? def __init__(self, *args, **kwargs):
??????? kwargs['key_format'] = 'I'
??????? super(WithXIndex, self).__init__(*args, **kwargs)
?
??? def make_key_value(self, data):
??????? a_val = data.get("x")
??????? if a_val is not None:
??????????? return a_val, None
??????? return None
?
??? def make_key(self, key):
??????? return key
?
db = Database('/tmp/tut2')
db.create()
?
x_ind = WithXIndex(db.path, 'x')
db.add_index(x_ind)
?
print db.insert({'x': 1})


?
Count
?
from CodernityDB.database import Database
?
db = Database('/tmp/tut1')
db.open()
?
print db.count(db.all, 'x')

?
Get
?
from CodernityDB.database import Database
?
db = Database('/tmp/tut2')
db.open()
?
print db.get('x', 1, with_doc=True)

?
Delete
?
from CodernityDB.database import Database
?
db = Database('/tmp/tut2')
db.open()
?
curr = db.get('x', 1, with_doc=True)
doc? = curr['doc']
?
db.delete(doc)


?
Update
?
from CodernityDB.database import Database
?
db = Database('/tmp/tut2')
db.create()
?
curr = db.get('x', 1, with_doc=True)
doc? = curr['doc']
?
doc['Updated'] = True
db.update(doc)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 成人欧美一区二区三区视频xxx | 一区二区三区杨幂在线观看 | 一级毛片欧美 | 精品欧美乱码久久久久久 | 中文字幕乱码一区二区三区 | 亚洲aaa视频| 国产高清第一页 | 日韩五月| 亚洲一区二区免费视频 | 色两性午夜视频免费观看 | 国产永久免费 | 小明成人永久视频在线观看 | 9久久99久久久精品齐齐综合色圆 | 99热新| 免费精品美女久久久久久久久久 | 国产一区二区精品 | 天天人人精品 | 91精品观看91久久久久久 | 粉嫩粉嫩一区二区三区在线播放 | 欧美成人一区在线 | 日韩成人在线视频 | 国产一区二区欧美 | 在线视频亚洲 | 一级毛片在线观看视频 | 国产露脸精品爆浆视频 | 日本黄色小视频在线观看 | 先锋资源站 | 久久草在线视频 | 亚洲香蕉久久一区二区三区四区 | 在线视频综合视频免费观看 | 欧美成人免费高清二区三区 | 小明看看成人免费视频 | 青青久操视频 | 一区二区在线 | 成人一区二区三区在线 | 日韩国产欧美视频 | 亚洲激情综合 | 日日摸夜夜添夜夜添精品视频 | 欧美阿v天堂视频在99线 | 在线视频中文字幕乱人伦 | 午夜特级毛片 |