Finished:

-sqlite altering
-implemented mysql
Todo:
-Merge SqlTableCreator into the querybuilders or make it static
-Make all the managers use the querybuilder for making tables. (See GroupManager.cs for an example)
-Implement more datatypes (see TypesAsStrings in IQueryBuilder.cs)
This commit is contained in:
high 2011-08-03 18:37:42 -04:00
parent 3e045d51bf
commit 423a33325a
5 changed files with 101 additions and 20 deletions

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using MySql.Data.MySqlClient;
namespace TShockAPI.DB
{
@ -18,13 +19,13 @@ namespace TShockAPI.DB
string query = "";
var table = new SqlTable("GroupList",
new SqlColumn("GroupName", "TEXT") { Primary = true },
new SqlColumn("Commands", "TEXT"),
new SqlColumn("ChatColor", "TEXT")
/*var table = new SqlTable("GroupList",
new SqlColumn("GroupName", MySqlDbType.VarChar, 32) { Primary = true },
new SqlColumn("Commands", MySqlDbType.Text),
new SqlColumn("ChatColor", MySqlDbType.Text)
);
//new SqlTableCreator(db).EnsureExists(table);
new SqlTableCreator(db, new MysqlQueryCreator()).EnsureExists(table);*/
if (db.GetSqlType() == SqlType.Sqlite)