We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dd40d36 + 0e989be commit b103e57Copy full SHA for b103e57
README.md
@@ -39,6 +39,30 @@ Metric = Table(
39
metadata.create_all(engine)
40
```
41
42
+Or using `declarative_base` style:
43
+
44
+```Python
45
+import datetime
46
47
+from sqlalchemy.orm import declarative_base
48
+from sqlalchemy import Column, Float, String, DateTime
49
50
+Base = declarative_base()
51
52
+class Metric(Base):
53
+ __table_args__ = ({
54
+ 'timescaledb_hypertable': {
55
+ 'time_column_name': 'timestamp'
56
+ }
57
+ })
58
59
+ name = Column(String)
60
+ value = Column(Float)
61
+ timestamp = Column(
62
+ DateTime(), default=datetime.datetime.now, primary_key=True
63
+ )
64
+```
65
66
## Functions
67
68
Timescaledb functions implemented:
0 commit comments