Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new SchemaProvider for the specified database
        /// </summary>
        /// <param name="forDatabase"></param>
        /// <returns></returns>
        public DBSchemaProvider CreateSchemaProvider(DBDatabase forDatabase)
        {
            if (null == forDatabase)
            {
                throw new ArgumentNullException("forDatabase");
            }
            if (string.IsNullOrEmpty(forDatabase.ConnectionString))
            {
                throw new ArgumentNullException("forDatabase.ConnectionString");
            }

            DBDatabaseProperties properties = this.CreateDatabaseProperties(forDatabase);

            return(this.CreateSchemaProvider(forDatabase, properties));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new StatementBuilder for the specified database
        /// using the textWriter as a backing store
        /// </summary>
        /// <param name="forDatabase"></param>
        /// <param name="textWriter"></param>
        /// <returns></returns>
        public DBStatementBuilder CreateStatementBuilder(DBDatabase forDatabase, System.IO.TextWriter textWriter)
        {
            if (null == forDatabase)
            {
                throw new ArgumentNullException("forDatabase");
            }
            if (string.IsNullOrEmpty(forDatabase.ConnectionString))
            {
                throw new ArgumentNullException("forDatabase.ConnectionString");
            }

            if (null == textWriter)
            {
                throw new ArgumentNullException("textWriter");
            }

            DBDatabaseProperties properties = this.CreateDatabaseProperties(forDatabase);

            return(this.CreateStatementBuilder(forDatabase, properties, textWriter, false));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Abstract method that inheritors must override to return a new instance of
 /// the provider specific database schema provider
 /// </summary>
 /// <param name="forDatabase">The database (and contained connection) that the builder must generate statements for</param>
 /// <param name="properties">The properties of the database.</param>
 /// <returns>A new schema provider</returns>
 protected abstract DBSchemaProvider CreateSchemaProvider(DBDatabase forDatabase, DBDatabaseProperties properties);
Ejemplo n.º 4
0
 /// <summary>
 /// Abstract method that inheritors must override to return a new instance of
 /// the provider specific database statement builder
 /// </summary>
 /// <param name="forDatabase">The database (and contained connection) that the builder must generate statements for</param>
 /// <param name="withProperties">The properties of the database.</param>
 /// <param name="writer">The TextWriter the statement builder uses to output the SQL statemtent to.</param>
 /// <param name="ownsWriter">true if the new instance owns the text writer and should dispose of it when the builder is disposed</param>
 /// <returns>A new DBStatementBuilder subclass</returns>
 protected abstract DBStatementBuilder CreateStatementBuilder(DBDatabase forDatabase, DBDatabaseProperties withProperties, System.IO.TextWriter writer, bool ownsWriter);