#region License
// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
// This source code is made available under the terms of the GNU Lesser General Public License v3.0
// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
#endregion
using System.Collections.Generic;
using System.Data.Common;
namespace MiniSqlQuery.Core.DbModel
{
/// The ole db schema service.
public class OleDbSchemaService : GenericSchemaService
{
/// The get db types.
/// The connection.
///
public override Dictionary GetDbTypes(DbConnection connection)
{
var types = base.GetDbTypes(connection);
foreach (var dbType in types.Values)
{
if (dbType.CreateFormat.Length == 0)
{
// probably MS Access
switch (dbType.Name)
{
case "VarChar":
dbType.CreateFormat = "VarChar({0})";
break;
case "VarBinary":
dbType.CreateFormat = "VarBinary({0})";
break;
}
}
}
return types;
}
}
}