1. 程式人生 > >python實現的NoSql資料庫系列-基本資料庫操作

python實現的NoSql資料庫系列-基本資料庫操作

本文是資料庫的基本操作,會陸續更新
# -*-coding:utf-8-*-
from python_based_db.db import Database


class BasicOperation(Database):
    def __init__(self):
        self.db = super().db_dict
        self.params = None

    def basic_set(self):
        self.db[self.params[0]] = self.params[1]

    def basic_get(self)
:
return self.db.get(self.params[0]) def basic_del(self): del super().db_dict[self.params[0]] def basic_set_list(self): key = self.params[0] val_list = list(self.params[1:]) self.db[key] = val_list def basic_get_list(self): return self.db.get(self.params[0
]) def basic_get_list_mem(self): pass def basic_del_list(self): pass def basic_set_olist(self): pass def basic_get_olist(self): pass def basic_get_olist_mem(self): pass def basic_del_olist(self): pass def basic_del_olist
(self):
pass def basic_del_olist(self): pass def basic_del_olist(self): pass def basic_set_dict(self): pass def basic_get_dict(self): pass def basic_del_dict(self): pass