:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { DateTime } from 'luxon'
import { Properties } from '~/plugin-scaffold'
import { Group, GroupTypeIndex, ProjectId, PropertiesLastOperation, PropertiesLastUpdatedAt, TeamId } from '~/types'
import { GroupKey } from './group-repository.interface'
export interface GroupRepositoryTransaction {
fetchGroup(
teamId: TeamId,
groupTypeIndex: GroupTypeIndex,
groupKey: string,
options?: { forUpdate?: boolean; useReadReplica?: boolean }
): Promise<Group | undefined>
fetchGroupsByKeys(keys: GroupKey[]): Promise<
{
team_id: TeamId
group_type_index: GroupTypeIndex
group_key: string
group_properties: Record<string, any>
}[]
>
insertGroup(
teamId: TeamId,
groupTypeIndex: GroupTypeIndex,
groupKey: string,
groupProperties: Properties,
createdAt: DateTime,
propertiesLastUpdatedAt: PropertiesLastUpdatedAt,
propertiesLastOperation: PropertiesLastOperation
): Promise<number>
updateGroup(
teamId: TeamId,
groupTypeIndex: GroupTypeIndex,
groupKey: string,
groupProperties: Properties,
createdAt: DateTime,
propertiesLastUpdatedAt: PropertiesLastUpdatedAt,
propertiesLastOperation: PropertiesLastOperation,
tag: string
): Promise<number | undefined>
// Group Type Methods
fetchGroupTypesByProjectIds(
projectIds: ProjectId[]
): Promise<Record<string, { group_type: string; group_type_index: GroupTypeIndex }[]>>
fetchGroupTypesByTeamIds(
teamIds: TeamId[]
): Promise<Record<string, { group_type: string; group_type_index: GroupTypeIndex }[]>>
insertGroupType(
teamId: TeamId,
projectId: ProjectId,
groupType: string,
index: number,
createdAt: DateTime
): Promise<[GroupTypeIndex | null, boolean]>
}