Spaces:
Sleeping
Sleeping
Update app/storage.py
Browse files- app/storage.py +10 -0
app/storage.py
CHANGED
|
@@ -1,4 +1,14 @@
|
|
| 1 |
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
tone=excluded.tone,
|
| 3 |
language=excluded.language,
|
| 4 |
constraints_json=excluded.constraints_json,
|
|
|
|
| 1 |
from __future__ import annotations
|
| 2 |
+
value_per_conversion: float):
|
| 3 |
+
with get_conn() as con:
|
| 4 |
+
con.execute(
|
| 5 |
+
"""
|
| 6 |
+
INSERT INTO campaigns (campaign_id, brand, product, target_audience, tone, language, constraints_json, value_per_conversion)
|
| 7 |
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
| 8 |
+
ON CONFLICT(campaign_id) DO UPDATE SET
|
| 9 |
+
brand=excluded.brand,
|
| 10 |
+
product=excluded.product,
|
| 11 |
+
target_audience=excluded.target_audience,
|
| 12 |
tone=excluded.tone,
|
| 13 |
language=excluded.language,
|
| 14 |
constraints_json=excluded.constraints_json,
|