r"""Construct a CHECK constraint.
:param sqltext:
- A string containing the constraint definition, which will be used
- verbatim, or a SQL expression construct. If given as a string,
- the object is converted to a :class:`.Text` object. If the textual
- string includes a colon character, escape this using a backslash::
+ A string containing the constraint definition, which will be used
+ verbatim, or a SQL expression construct. If given as a string,
+ the object is converted to a :func:`.text` object. If the textual
+ string includes a colon character, escape this using a backslash::
- CheckConstraint(r"foo ~ E'a(?\:b|c)d")
+ CheckConstraint(r"foo ~ E'a(?\:b|c)d")
:param name:
Optional, the in-database name of the constraint.
lines.append(to_inject)
lines.append("\n")
to_inject = None
+ elif line.endswith("::"):
+ # TODO: this still wont cover if the code example itself has blank
+ # lines in it, need to detect those via indentation.
+ lines.append(line)
+ lines.append(doclines.pop(0)) # the blank line following a code example
+ continue
lines.append(line)
return "\n".join(lines)