
Originally Posted by
Swoosh91
Yeah true, no stored procedures is a bummer. It supports float though - check "real" datatype :)
I'm interested how you will solve your own flatfile database problem. if you create a format which supports stored procedures, that'd be cool. Never did that, since all the logic I use normally resides in some dll or internal class.
I don't have to solve a flatfile database problem; not using one. I'm making my own SQL compliant
database format. I'm working on the scripting engine right now.
When I began work on this, I couldn't come up with anything to name the database so I called it
the X Database, or XDB. I suppose I'm satisfied with the name...
To give a hint at the extent of the database engine, here is a class for multiplication in the
scripting engine:
Code:
using XDB.Engine.Internal;
namespace XDB.Engine.Core.Scripting
{
internal class Multiplication : Signature
{
internal Multiplication(string name, int groupId)
: base(name, groupId, Operations.Nomark, Priorities.Mutliplication, XDBType.Unknown)
{
AddParameter(XDBType.Unknown);
AddParameter(XDBType.Unknown);
}
internal override Signature DoCloneSignature()
{
return new Multiplication(new string(Name), Group)
{
Entry = Entry
};
}
protected override void OnFixReturnTypeAndParameters(Collector collector, int offset, XDBType newType)
{
var returnType1 = collector[offset].Signature.ReturnType;
var returnType2 = collector[offset + 1].Signature.ReturnType;
SetParameterType(0, returnType1);
SetParameterType(1, returnType2);
base.OnFixReturnTypeAndParameters(collector, offset, Summation.ReturnXDBType(returnType1, returnType2));
}
protected override void OnExecute(ProcedureCode pcode, int entry, Connection connection,
DataStorage contextStorage, Row contextRow, ref bool bypassNextGroup, Row rowResult)
{
var pCodeUnit1 = pcode[entry];
var pCodeUnit2 = pcode[entry + 1];
pCodeUnit1.ResultColumn *= pCodeUnit2.ResultColumn;
}
}
}
@twister: not sure when it'll be ready for release yet. I'm a bit tied up with the database feature of
the project.