internal string GetDbIdType(DaoDbType type)
        {
            switch (type)
            {
            case DaoDbType.Invalid:
                break;

            case DaoDbType.Odbc:
                break;

            case DaoDbType.OleDb:
                break;

            case DaoDbType.MSSql:
                return("bigint");

            case DaoDbType.Firebird:
                return("INTEGER");

            case DaoDbType.SQLite:
                return("INTEGER");

            default:
                break;
            }

            return("");
        }
 public DaoContextProviderFactory(DaoDbType type, string connectionString, bool initEmbedded) : this(type)
 {
     Expect.IsNotNullOrEmpty(connectionString, "Connection string cannot be empty");
     this.ConnectionString = connectionString;
     if ((type == DaoDbType.Firebird || type == DaoDbType.SQLite) &&
         initEmbedded)
     {
         this.InitEmbeddedDb();
     }
 }
Beispiel #3
0
        public static void SetContextDatabaseType(string contextName, DaoDbType type)
        {
            lock (lockContextTypes)
            {
                if (contextDatabaseTypes.ContainsKey(contextName))
                {
                    if (contextDatabaseTypes[contextName] == type)
                    {
                        return;
                    }

                    ExceptionHelper.Throw <InvalidOperationException>(
                        "Cannot set database provider type on DaoContext '{0}' to '{1}' because it has already been set to '{2}'",
                        contextName, type.ToString(), contextDatabaseTypes[contextName]);
                }
                else
                {
                    contextDatabaseTypes.Add(contextName, type);
                }
            }
        }
Beispiel #4
0
 private DatabaseAgent GetAgent(DaoDbType type)
 {
     return(DatabaseAgent.GetAgent(LogEventData.ContextName, type));
 }
Beispiel #5
0
 public void Initialize(DaoDbType type)
 {
     this.DatabaseAgent = GetAgent(type);
 }
 public UnableToDetermineConnectionStringException(string contextName, DaoDbType type)
     : base("Unable to determine connection string from default configuration for contextName '" + contextName + "' DaoDbType '" + type.ToString() + "'")
 {
 }
 public DaoContextProviderFactory(DaoDbType type)
 {
     this.type = type;
 }
 public DaoContextProviderFactory(DaoDbType type, string connectionString)
     : this(type, connectionString, true)
 {
 }
 public DatabaseEventStore(DaoDbType type)
     : this()
 {
     this.DaoDbType = type;
 }
Beispiel #10
0
 public DatabaseEventStore(DaoDbType type)
     : this()
 {
     this.DaoDbType = type;
 }
Beispiel #11
0
 public UnableToDetermineConnectionStringException(string contextName, DaoDbType type)
     : base("Unable to determine connection string from default configuration for contextName '" + contextName + "' DaoDbType '" + type.ToString() + "'")
 {
 }
Beispiel #12
0
 public void Initialize(DaoDbType type)
 {
     this.DatabaseAgent = GetAgent(type);
 }
Beispiel #13
0
 private DatabaseAgent GetAgent(DaoDbType type)
 {
     return DatabaseAgent.GetAgent(LogEventData.ContextName, type);
 }