MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / Column

Class Column

lib/sqlalchemy/sql/schema.py:1497–2702  ·  view source on GitHub ↗

Represents a column in a database table.

Source from the content-addressed store, hash-verified

1495
1496
1497class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]):
1498 """Represents a column in a database table."""
1499
1500 __visit_name__ = "column"
1501
1502 inherit_cache = True
1503 key: str
1504
1505 server_default: Optional[FetchedValue]
1506
1507 def __init__(
1508 self,
1509 __name_pos: Optional[
1510 Union[str, _TypeEngineArgument[_T], SchemaEventTarget]
1511 ] = None,
1512 __type_pos: Optional[
1513 Union[_TypeEngineArgument[_T], SchemaEventTarget]
1514 ] = None,
1515 *args: SchemaEventTarget,
1516 name: Optional[str] = None,
1517 type_: Optional[_TypeEngineArgument[_T]] = None,
1518 autoincrement: _AutoIncrementType = "auto",
1519 default: Optional[Any] = _NoArg.NO_ARG,
1520 insert_default: Optional[Any] = _NoArg.NO_ARG,
1521 doc: Optional[str] = None,
1522 key: Optional[str] = None,
1523 index: Optional[bool] = None,
1524 unique: Optional[bool] = None,
1525 info: Optional[_InfoType] = None,
1526 nullable: Optional[
1527 Union[bool, Literal[SchemaConst.NULL_UNSPECIFIED]]
1528 ] = SchemaConst.NULL_UNSPECIFIED,
1529 onupdate: Optional[Any] = None,
1530 primary_key: bool = False,
1531 server_default: Optional[_ServerDefaultArgument] = None,
1532 server_onupdate: Optional[_ServerOnUpdateArgument] = None,
1533 quote: Optional[bool] = None,
1534 system: bool = False,
1535 comment: Optional[str] = None,
1536 insert_sentinel: bool = False,
1537 _omit_from_statements: bool = False,
1538 _proxies: Optional[Any] = None,
1539 **dialect_kwargs: Any,
1540 ):
1541 r"""
1542 Construct a new ``Column`` object.
1543
1544 :param name: The name of this column as represented in the database.
1545 This argument may be the first positional argument, or specified
1546 via keyword.
1547
1548 Names which contain no upper case characters
1549 will be treated as case insensitive names, and will not be quoted
1550 unless they are a reserved word. Names with any number of upper
1551 case characters will be quoted and sent exactly. Note that this
1552 behavior applies even for databases which standardize upper
1553 case names as case insensitive such as Oracle Database.
1554

Callers 15

test_override_builtinMethod · 0.90
test_column_proxyMethod · 0.90
test_subquery_proxyMethod · 0.90
test_alias_proxyMethod · 0.90
test_binary_propagateMethod · 0.90
test_containsMethod · 0.90
test_getitemMethod · 0.90

Calls

no outgoing calls

Tested by 15

test_override_builtinMethod · 0.72
test_column_proxyMethod · 0.72
test_subquery_proxyMethod · 0.72
test_alias_proxyMethod · 0.72
test_binary_propagateMethod · 0.72
test_containsMethod · 0.72
test_getitemMethod · 0.72