// ***********************************************************************
// Assembly : Unity
// Author : Kimch
// Created :
//
// Last Modified By : Kimch
// Last Modified On :
// ***********************************************************************
//
//
// ***********************************************************************
using System;
using System.Collections.Generic;
using G;
public class Database
{
private string _name;
private Archive _archive;
public string name
{
get { return _name; }
}
public Archive archive
{
get { return _archive; }
}
private Database(string name)
{
_name = name;
_archive = Archive.Create(name);
}
public static Database Create(string name)
{
return new Database(name);
}
#region 关系型
private Dictionary _tables = new Dictionary();
public Table CreateTable(Schema schema)
{
if (_tables.ContainsKey(schema.name))
{
throw new InvalidOperationException(string.Format("Table '{0}' is exists", schema.name));
}
var table = new Table(this, schema);
_tables[table.name] = table;
return table;
}
public Table GetTable(string name)
{
return _tables[name];
}
#endregion
#region 键值型
#endregion
}