Giter VIP home page Giter VIP logo

sqlinterpreter's Introduction

How to build

  • windows

    mingw32-make
  • linux

    make

Description

  • 使用bison(yacc)&flex(lex)生成concrete syntax tree
  • 解析语法树,得到相关信息,调用DEGUB_*方法可以进行查看

Data Structure about Database in MiniSQL.h

  • table

    struct Table
    {
        string table_name;  //表名
        int attr_count;				//表中属性的总个数
        Attribute attrs[32];	//表的所有属性列表, 最多32个属性
        ...
    };
  • attribute

    struct Attribute
    {
        string attr_name;
        int attr_type;	//属性的数据类型,分别为CHAR, FLOAT, INT
        int attr_key_type;//属性的主键类型,分别为PRIMARY, UNIQUE, NULL(EMPTY)
        int attr_len; 	//属性所存放的数据的长度,如果不是CHAR,则长度标记为4
        int attr_id;    //属性在表中是第几个
    };
  • condition

    //	用于描述判断条件的信息
    struct Condition
    {
        string attr_name;	//条件所对应的属性名
        int attr_type;      //属性名对用的类型
        string op_type;		//条件所用到的比较模式,分别为"<>", "=", ">=", "<=", "<", ">"
        string cmp_value;	//条件所需要进行比较的值
    };
    typedef list<Condition> Condition_list;
  • index

    //	用于描述索引信息
    struct Index
    {
        string index_name;
        string table_name;
        string attr_name;	//	索引所对应的属性
    };
  • record

    //insert into card values("", "", 1234.4);
    struct Record
    {
        string table_name;  //表名
        vector<string> attr_values; // 要插入的值
        int num_values; //插入的字段的个数,应该与存在表的字段数相同
    };
  • tuple(unused)

    struct Tuple: public Table
    {
        string attr_values[32];    
    };

TODO

  • API
  • Record Manager
  • Catalog Manager
  • Index Manager
  • Buffer Manger

sqlinterpreter's People

Contributors

molindeng avatar

Watchers

James Cloos avatar

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.