/// <summary> /// Generates a querie list to create tables. /// <para/> /// </summary> /// <returns>Returns a list of queries to create the local tables.</returns> private List <string> CreateTableQueries(ConcurrentDictionary <string, Table> tables) { try { List <string> tableQueries = new List <string>(); foreach (KeyValuePair <string, Table> table in tables) { SQLQueryBuilder sqb = new SQLQueryBuilder(); List <string> paramList = new List <string>(); int iter = 0; foreach (KeyValuePair <string, Type> column in table.Value.Columns) { sqb.AddValue(column.Key); if (iter.Equals(0)) { sqb.AddValue("AUTOINCREMENT").ParamPrimaryKey(); paramList.Add(sqb.Flush()); iter++; continue; } if (column.Value == typeof(int)) { sqb.TypeInteger(); } else if (column.Value == typeof(string)) { sqb.TypeText(); } else if (column.Value == typeof(double)) { sqb.TypeReal(); } else if (column.Value == typeof(float)) { sqb.TypeReal(); } else if (column.Value == typeof(DateTime)) { sqb.TypeDateTime(); } else { throw new NotSupportedException(column.Value.Name + " Datatype not supported"); } sqb.ParamNot().Null(); paramList.Add(sqb.Flush()); iter++; } string values = sqb.Brackets_Multiple(paramList, false).Flush(); sqb.Create().Table().AddValue(table.Value.TableName).AddValue(values); tableQueries.Add(sqb.ToString()); } return(tableQueries); } catch (Exception e) { throw e; } }