Beispiel #1
0
        /// <summary>
        /// Gets the schema for this table in quoted form if it is necessary.
        /// </summary>
        /// <param name="dialect">
        /// The <see cref="Dialect.Dialect" /> that knows how to quote the table name.
        /// </param>
        /// <returns>
        /// The schema name for this table in a form that is safe to use inside
        /// of a SQL statement. Quoted if it needs to be, not quoted if it does not need to be.
        /// </returns>
        public string GetQuotedSchemaName(Dialect.Dialect dialect)
        {
            if (schema == null)
            {
                return(null);
            }

            if (schema.StartsWith("`"))
            {
                return(dialect.QuoteForSchemaName(schema.Substring(1, schema.Length - 2)));
            }

            return(schema);
        }
Beispiel #2
0
 public string GetQuotedSchema(Dialect.Dialect dialect)
 {
     return(IsSchemaQuoted ? dialect.QuoteForSchemaName(schema) : schema);
 }