Search Forum
(53671 Postings)
Search Site/Articles

Archived Articles
712 Articles

C# Books
C# Consultants
What Is C#?
Download Compiler
Code Archive
Archived Articles
Advertise
Contribute
C# Jobs
Beginners Tutorial
C# Contractors
C# Consulting
Links
C# Manual
Contact Us
Legal

GoDiagram for .NET from Northwoods Software www.nwoods.com


 
Printable Version

SharpClaw DB Server In C#
By Matt Sieber

SharpClaw is an attempt to write a (somewhat) SQL compliant database server in C# (like SQL Server of MySQL). I developed it in my spare time, and although it has some areas which need much improvement, it is a fine piece of work so far. You will need to know a bit of SQL to use SharpClaw, but I'm sure many of you do.

The best way to learn about SharpClaw is to download the source files and give it a test drive. Much of the code is documented, though it helps if you have a decent understanding of database design.

Make sure you extract the files in the distribution to their original path. A directory called C:\SharpClaw will be created. In that directory, you will find a text file called SharpClaw_Documentation.txt. The instructions in this file will tell you where to go from there. Have fun! And be sure to check out the following examples of C# / .NET programming concepts:

Operator overloading

see DataUnits.DBInt, line 129 and following
(also found in the other datatypes in DataUnits)

Static constructor

see DataUnits.DBInt, line 38
(also found in the other datatypes in DataUnits)

Imlementation of IConvertible

Allows the conversion of a custom datatype to a .NET type by using System.Convert

see DataUnits.DBInt, line 248

B-Tree

The backbone of every database worth its salt is the b-tree (or a variant of the b-tree, such as the b+tree or b*tree). The b-tree algorithm used in SharpClaw is written in C# and based on pseudocode available online. Please see the References section of the documentation for links.

see Index.TableIndex, line 174 and following

Threading

SharpClaw runs a background thread to write blocks of data to the drive.

see FileIndex.Index, line 47 and line 110

Unsafe Code

While I generally love the lack of pointers in .NET, sometimes you just feel the need to rip a class apart and plunder the data inside. Nothing less than pointers will do!

see DataUnits.DBInt, line 13,
or, DataUnits.DBDataType, line 30 (DBDataType is the base class for DBInt)
or, SQLParser.DataConverter, line 10

Download SharpClaw_v0.1.zip