0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
posthog/ee/clickhouse/demo.py
2021-01-29 14:28:55 +01:00

16 lines
530 B
Python

from typing import Dict, List
from uuid import uuid4
from ee.clickhouse.models.event import create_event
from ee.clickhouse.models.session_recording_event import create_session_recording_event
def bulk_create_events(events: List[Dict], **kw):
for event_data in events:
create_event(**event_data, **kw, event_uuid=uuid4()) # type: ignore
def bulk_create_session_recording_events(events: List[Dict], **kw):
for data in events:
create_session_recording_event(**data, **kw, uuid=uuid4()) # type: ignore