MCPcopy
hub / github.com/sqldef/sqldef / parseCheckConstraint

Method parseCheckConstraint

database/postgres/parser.go:1513–1525  ·  view source on GitHub ↗
(constraint *pgquery.Constraint)

Source from the content-addressed store, hash-verified

1511}
1512
1513func (p PostgresParser) parseCheckConstraint(constraint *pgquery.Constraint) (*parser.CheckDefinition, error) {
1514 expr, err := p.parseExpr(constraint.RawExpr)
1515
1516 if err != nil {
1517 return nil, err
1518 }
1519
1520 return &parser.CheckDefinition{
1521 Where: *parser.NewWhere(parser.WhereStr, expr),
1522 ConstraintName: parser.NewIdent(constraint.Conname, false),
1523 NoInherit: parser.BoolVal(constraint.IsNoInherit),
1524 }, nil
1525}
1526
1527func (p PostgresParser) parseCreateSchemaStmt(stmt *pgquery.CreateSchemaStmt) (parser.Statement, error) {
1528 return &parser.DDL{

Callers 1

parseColumnDefMethod · 0.95

Calls 4

parseExprMethod · 0.95
NewWhereFunction · 0.92
NewIdentFunction · 0.92
BoolValTypeAlias · 0.92

Tested by

no test coverage detected