(ctx context.Context, tableName string, columName string)
| 219 | } |
| 220 | |
| 221 | func (c *Client) isColumnUnique(ctx context.Context, tableName string, columName string) (bool, error) { |
| 222 | rows, err := c.db.QueryContext(ctx, isColumnUniqueSQL, tableName, columName) |
| 223 | if err != nil { |
| 224 | return false, err |
| 225 | } |
| 226 | defer rows.Close() |
| 227 | for rows.Next() { |
| 228 | var n int |
| 229 | if err := rows.Scan(&n); err != nil { |
| 230 | return false, err |
| 231 | } |
| 232 | if n == 1 { |
| 233 | return true, nil |
| 234 | } |
| 235 | } |
| 236 | if err := rows.Err(); err != nil { |
| 237 | return false, err |
| 238 | } |
| 239 | |
| 240 | return false, nil |
| 241 | } |
| 242 | |
| 243 | func (c *Client) getTableInfo(ctx context.Context, tableName string) (*schema.Table, error) { |
| 244 | info := tableInfo{} |
no test coverage detected