matchSchema returns the predicate for matching table schema.
(columns ...string)
| 71 | |
| 72 | // matchSchema returns the predicate for matching table schema. |
| 73 | func (d *Postgres) matchSchema(columns ...string) *sql.Predicate { |
| 74 | column := "table_schema" |
| 75 | if len(columns) > 0 { |
| 76 | column = columns[0] |
| 77 | } |
| 78 | if d.schema != "" { |
| 79 | return sql.EQ(column, d.schema) |
| 80 | } |
| 81 | return sql.EQ(column, sql.Raw("CURRENT_SCHEMA()")) |
| 82 | } |
| 83 | |
| 84 | // maxCharSize defines the maximum size of limited character types in Postgres (10 MB). |
| 85 | const maxCharSize = 10 << 20 |
no test coverage detected