Coder Social home page Coder Social logo

ratabase's Introduction

Ratabase

使用哈希表实现的基于内存的键值数据库

运行

先运行数据库服务器,默认端口为9999:

make
./server

用客户端进行访问:

./client

设计

可以创建,管理和删除数据库。

数据库内支持三种结构的存储:

  • 字符串

ASCII 字符

  • 列表

可以存储不同类型元素,如 [123, "abc"]

  • 字典

存储一个或多个键值对

操作

数据库操作

创建数据库

create [db-name]

切换到某数据库

select [db-name]

删除数据库

delete [db-name]

显示数据库和创建时间

dispaly

字符串操作

创建一个字符串

sset [str-name] [string]

在字符串尾部添加字符

sapp [str-name] [append-string]

返回字符串长度

slen [str-name]

清除该字符串内容

sclr [str-name]

列表操作

创建一个列表,创建之初必须为同一类型

lset [lst-name] [new-elem]+

表尾添加元素,可以是任意类型

lpush [lst-name] [new-elem]

表头删除元素

lpop [lst-name]

返回某表的大小

lsize [lst-name]

表中寻找一个元素,返回其索引

lidx [lst-name] [elem]

在表中某位置插入元素

lput [lst-name] [index] [new-elem]

返回某位置上的元素

lget [lst-name] [index]

在表中删除删除某个元素

ldel [lst-name] [elem]

字典操作

创建一个或多个键值对作为字典内容

dset [dict-name] {[key] [value]}+

添加一个键值对,如果键存在,则更新它的值

dadd [dict-name] {[key] [value]}+

删除某个键值对

ddel [dict-name] [key]

返回字典大小

dsize [dict-name]

查找某个键值对

dget [dict-name] [key]

Undo

  • 支持磁盘持久化存储
  • 按名称查找和打印内容
  • 添加更多数据结构

ratabase's People

Contributors

rjerk avatar

Stargazers

Eason Wang avatar groot avatar

Watchers

James Cloos avatar  avatar

ratabase's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.