Giter Site home page Giter Site logo

321db's Introduction

Project Name: 321-database
Author:       Matthew A. Terry ([email protected])
Date created: 10/11/09
===============================================================================
Description:  This is a standard relational database management system complete
              with a menu-driven user interface for accessing, modifying, and
              managing the database.
Features:     - Takes dbscript files and compiles them into a database dictionary
                - supports primary key and foreign key constraints
              - Allows for users to use the compiled database by:
                - filling in new relations
                - querying the dataset
                - updating and removing relations
===============================================================================
How to install:
  - AT PRESENT: DO NOT INSTALL -- this project may potentially cause serious
    damage to the memory contents of your system.
  - Install on a Unix or Unix-like system (this can include Cygwin)
  - Download the version tar-ball from http://github.com/mterry/321db
    - Alternatively download the most recent build using git
  - untar the tar-ball to whichever directory you want
  - Change your working directory to the untarred project
  - Run make using the makefile included with the project
    - Target all will build the entire project
  - Run the project by running ./bin/321db
    - HEAVILY RECOMMENDED TO NOT DO THIS AT PRESENT
===============================================================================
FAQ:
  Q:  Why is the <insert module here> menu not reading in the location I
      specified?
    A:  You have to navigate down to the "submit" button on the form and press
        Enter on the keypad to correctly guarantee all inputted content is
        submitted.
  Q:  I don't have a keypad: how do I submit anything?
    A:  You're welcome to change the source for the project -- in each module,
        there's a loop in run_<insert module name> which handles all user input.
        Change the key neccessary for the break condition.
  Q:  Can you implement <insert feature here>?
    A:  You want it implemented, either submit an issue on the github
        (http://github.com/mterry/321db) or fork the repository and implement
        it yourself; if I like it, I may decide to accept your commits or
        implement your idea; however, all submitted ideas will get appropriated
        and you will not be guaranteed any credit, so don't expect any. If you
        submit code, all credit for the code is yours.
  Q:  Can you fix <insert bug here>?
    A:  Submit a detailed bug report on the github: include the version number,
        the module, and how to reproduce the bug or error. I will attempt to get
        back to you as quickly as I can. Alternatively, you can always fork the
        repo, fix the bug yourself, and submit the commits upstream for review.
  Q:  Why is it written in C? Can you port it to other languages?
    A:  No, I won't port it to other languages. If you want to, you're welcome
        to. Just keep your port in a copyleft license and we'll be kosher. As
        far as why it's written in C, well, it's because the school project
        detailed that we had to do it in C. If I had my way, it would have been C++.
  Q:  Why does your program crash when I attempt to compile an SQL file
    A:  There is a documented bug in the dbcompile module regarding a memory
        corruption error while compiling the database. See issue 23 on the
        github for more details. If anyone wishes to correct this issue,
        or has any information on why it is occuring, please feel free to
        comment on the issue or submit a commit which will correct the bug.
  Q: Why is <insert module name> not complete?
    A:  Due to time constraints and poor time management, and the aforementioned
        memory corruption error, my time was slowly eaten up over the course of
        the project timeline, until there was no time left.
===============================================================================
Changelog:
10/12/19:
> Took another look at dbcompile; I have yet still to find an answer.
> BROKEN: dbcompile is left broken due to an unsolvable (by me) memory corruption
  bug; it compiles and runs, but realloc() throws a segfault when attempting to
  expand the number of attributes in a table, due to attribute count being
  trashed by the bug. Reference: issue 23 on github.
> Completed rewrite of crel.c and crel.h, and rewrote dbcompile.c. All memory
  leaks from dbcompile have been eliminated, as well as that nasty malloc issue;
  spaghetti code has been reduced to nil, and only well structured code remains.
  The final piece of dbcompile is next: writing the actual dictionary files out.
> Merge branch 'dbfill'
> Deprecated the old crel.h and crel.c, and moved them to old_crel.h and old_crel.c,
  respectively. Rewrote crel.h and crel.c from scratch, in a more efficient and
  easier to debug method.
> Merge branch 'dbcompile'
> Manually created the .dic files in etc/db_store in order to implement dbfill.
  Also modified create_sp.sql to be properly read in by dbcompile, modified a
  host of other files while developing dbcompile, which has been halted (due
  to being broken: see issue 20 and 22 on github), and created run_dbfill() in
  dbfill.c and created include/db_fill.h. Also added hooks to db_menu to run
  the db_fill menu. 
> Updated README with FAQs, install instructions, and some other content. Moved
  trim() out of dbcompile and into its own module (src/common/trim.c and
  include/common/trim.h).
10/12/18:
> Added the submit button to the dbcompile menu and updated some functions in
  crel.c.
> Updated readme with all current changes for the master branch.
> Updated readme with all current changes for the master branch.
> Implemented adding and removing of tables and attributes.
> Modified crel.c and crel.h for the new method of storing and accessing
  attributes and tables. Also added foreign key support.
10/12/17:
> Updated run_dbcompile(). Now explicitly specifies that the second field is
  optional. This assists with issue 18 on the github.
> Fixed trim(). istrimmable specifies the characters that you want to save now.
> Fixed the null pointer bug, the freeing field bug, and the main menu rendering
  issue.
> Updated dbcompile.h, dbcompile.c, dbmenu.c; attempting to track down a null
  pointer bug.
10/12/16:
> Now reading in content from dbcompile forms and truncating strings to remove
  whitespace.
> New menu for dbcompile implemented roughly.
> Wrote the add table and add attribute functions in crel.c
10/12/15:
> Project now compiles -- content free ATM, but dbmenu now works. This is
  beneficial to a more agile/extreme method approach to software development, as
  the project can be compiled and run as parts begin to work.
10/12/10:
> Added more functions to crel.h
10/12/09:
> Removed cmap.c and cmap.h, and instead replaced them with crel.c and crel.h,
  the source and header files for the relation structure definitions and handling
  functions. Parsing will be tackled next.
> Updated README.
10/12/02:
> Killed Subversion repository; removed directories added for the purposes of
  Subversion. Added src/common and include/common for common library functions
  and data structures. Also began work on a C-based map data structure
  (include/common/cmap.h and src/common/cmap.c) which is intended to be used
  for the SQL parsing engine.
10/11/25:
> Constructed Subversion repository; added directories trunk, tags, and
  branches; edited README
10/11/09:
> First commit: added the readme (this file) as well as constructed the
  directory structure.

321db's People

Contributors

mterry avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

321db's Issues

Makefile not working

The makefile in its former form was not working after modifying for dbmenu. For now, manual compilation of project is necessary.

Fix dbcompile.c

Due to a heap corruption bug, dbcompile is broken. This will need to be rectified.

In order to proceed with the remainder of the project, the debugging has been put off, and a manually constructed database dictionary has been created in order to implement and test the remaining modules.

Memory corruption issue causing segfault

During the formation of the database in read_db_definition() in dbcompile.c, there is a memory corruption issue which causes the currently open table's values to corrupt, and, as a result, causes realloc() to throw a segfault. This issue is well beyond me to attempt to fix, in any amount of reasonable time.

dbupdate hooks for dbmenu.c

For dbupdate.c to work with the project, hooks need to be made for dbmenu to call the correct functions to run dbupdate.

Crash on freeing field[1]

SIGABRT being thrown by system when attempting to free field[1]. Maybe field[1] isn't being allocated properly?

Null pointer bug from get_field_buffer()

For some reason, field_buffer() from form.h is throwing me a null pointer for accessing my field, and that null pointer is causing the rest of the program to fail.

Milestone #2

Create the database parsing engine and implement dbfill.

Milestone #1

Complete the relation structure definitions and handling functions. Implement dbcompile.

dbfill hooks for dbmenu.c

For dbfill.c to work with the project, hooks need to be made for dbmenu to call the correct functions to run dbfill.

dbcompile hooks for dbmenu.c

For dbcompile.c to work with the project, hooks need to be made for dbmenu to call the correct functions to run dbcompile.

Update README.

Needs to be updated with all current changes in the changelog.

dbquery hooks for dbmenu.c

For dbquery.c to work with the project, hooks need to be made for dbmenu to call the correct functions to run dbquery.

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.