Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Latest commit

 

History

History

dbms

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

DBMS interface

  • Author: Jack Jiang
  • Date: Jul. 2019

DBMS interface. The implementation is not important for this tutorial.

Overview

model_name Implementation
dict_db Python dictionary
json_db File System (Json Format)

Usage

from dbms.model_name.model import Model
model = Model()

value = model.method(args)

Method

Create

def create(self, key: str, value: dict) -> bool:
    '''
    key = "1"
    value = {"firstName": "Jack", "lastName": "Jiang"}
    return = True when succeed
             False when faild
    '''

Read

def read(self, key: str) -> dict:
    '''
    key = "1"
    reutrn = {"firstName": "Jack", "lastName": "Jiang"}
             None when key does not exist
    '''

Update

def update(self, key: str, value: dict) -> bool:
    '''
    key = "1"
    value = {"firstName": "Jack", "lastName": "Jiang"}
    return = True when succeed
             False when faild
    '''

Delete

def delete(self, key: str) -> bool:
    '''
    key = "1"
    return = True when succeed
             False when key does not exist
    '''

Debug

def debug(self) -> dict:
    '''
    return = database if implemented
             None if not implemented
    '''