Coder Social home page Coder Social logo

database's Introduction

Database

SQL database implemented in C#

Guide to implementation source files:

Public.cs = public interface.

WebServer.cs = main program, http web server ( example client ).

Init.cs = SQL initialisation script.

Compile.bat is file to compile source ( will need editing depending on version of .NET you have installed ).

SQL-independent ( namespace DBNS )

Database.cs = implements Database.

Log.cs = log file to ensure atomic updates.

Stream.cs = fully buffered stream for Rollback/Commit.

Table.cs = implementation of TABLE.

IndexFile.cs, IndexPage.cs = implementation of INDEX.

Util.cs = various utility classes.

SQL-specific ( namespace SQLNS )

SqlExec.cs = parsing and execution of SQL statements.

Block.cs = list of statements for execution.

Exp.cs, ExpStd.cs, ExpConv.cs = scalar expressions.

TableExp.cs = table-valued expressions.

Group.cs = implementation of GROUP BY.

Sort.cs = implementation of ORDER BY.

IdSet.cs = optimisation of WHERE.

Configuration

The database files are stored in C:\Databasefiles\Test\ this directory needs to be created. See webserver.cs to change the location. Also, permission to listen needs to be granted, e.g.

netsh http add urlacl url=http://+:8080/ user=GEORGE-DELL\pc

Again, see webserver.cs to change the http setup. If localhost is used, no permission is needed.

Implementation details

Database tables are kept in files with a fixed record size. This is possible because variable length values ( string and binary ) are encoded and stored seperately. The encoding is currently simply the offset in the system string or binary file.

The other type of file is an index file. Index files are B-Trees where each page has a fixed maximum size ( 4 kb at the time of writing ), when a page overflows it is split, and the new page is recorded in a parent page. See indexpage.cs for the details.

Manual

When the webserver runs, a link to a manual included with the program is displayed. Alternatively see https://georgebarwood.github.io/ for a copy of the manual.

database's People

Contributors

georgebarwood avatar

Stargazers

ksemenenko avatar  avatar  avatar

Watchers

 avatar

database's Issues

Problem if stored function and procedure have same name

Currently all "Blocks" have the same lookup dictionary in DatabaseImpl, which will cause issues if a stored procedure or function ( in the same schema ) have the same name.

Fix would be either to use separate dictionaries, or perhaps not allow name sharing.

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.