Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hammerhead committed Dec 2, 2022
1 parent e79f46f commit d22aa30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/sqlalchemy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ system`_::
...
... id = sa.Column(sa.String, primary_key=True, default=gen_key)
... name = sa.Column(sa.String)
... name_normalized = sa.Column(sa.String, sa.Computed("lower(name)"))
... quote = sa.Column(sa.String)
... details = sa.Column(types.Object)
... more_details = sa.Column(ObjectArray)
... more_details = sa.Column(types.ObjectArray)
... name_ft = sa.Column(sa.String)
... quote_ft = sa.Column(sa.String)
...
Expand All @@ -197,6 +198,8 @@ In this example, we:
- Use the ``gen_key`` function to provide a default value for the ``id`` column
(which is also the primary key)
- Use standard SQLAlchemy types for the ``id``, ``name``, and ``quote`` columns
- Define a computed column `name_normalized` (based on `name`) that translates
into a generated column
- Use the `Object`_ extension type for the ``details`` column
- Use the `ObjectArray`_ extension type for the ``more_details`` column
- Set up the ``name_ft`` and ``quote_ft`` fulltext indexes, but exclude them from
Expand Down

0 comments on commit d22aa30

Please sign in to comment.