query

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUERY_AddCampaign = "INSERT into campaigns" +
		"(" +
		"namespace,name,description,cron_expression," +
		"occurrences,communication_channel,status,type,schedule_type," +
		"query,inaction_query,inaction_duration,attributes," +
		"created_by_actorId,created_by_actorType" +
		") " +
		"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
	QUERY_UpdateCampaign = "UPDATE campaigns SET " +
		"name = ?, cron_expression = ?, status = ?, " +
		"query = ?,  namespace=?, occurrences = ?, " +
		"communication_channel=?, type=?, description=?, " +
		"schedule_type=?, inaction_query=?, inaction_duration =?, " +
		"attributes=?, updated_by_actorId = ?, updated_by_actorType = ?, " +
		"version = version + 1 WHERE id = ?"
	QUERY_AddCampaignTemplate = "INSERT into campaign_templates" +
		"(" +
		"campaign_id,template_name," +
		"campaign_name,distribution_percent" +
		") " +
		"values (?,?,?,?)"
	QUERY_DeleteCampaignTemplate = "DELETE FROM campaign_templates " +
		"WHERE campaign_id = ?"
	QUERY_AddNewCampaign   = ""
	QUERY_GetUserList      = ""
	QUERY_FindCampaignById = "SELECT id,namespace,name,description,cron_expression," +
		"occurrences,communication_channel,status,type,schedule_type, " +
		"query, inaction_query, inaction_duration, attributes, created_by_actorId," +
		"created_by_actorType,updated_by_actorId,updated_by_actorType,version," +
		"created_at,updated_at,deleted_at " +
		"FROM campaigns " +
		"WHERE id = ?"
	QUERY_FindControlGroupByCampaignId = "SELECT id,campaign_id,attributes,bloom_filter " +
		"FROM control_group " +
		"WHERE campaign_id = ?"
	QUERY_FindCampaignTemplateById = "SELECT id,campaign_id,template_name,campaign_name,distribution_percent " +
		"FROM campaign_templates " +
		"WHERE campaign_id = ?"
	QUERY_AddTargetUser = "INSERT into target_users" +
		"(" +
		"campaign_id,user_id,user_type,attributes" +
		") " +
		"values (?,?,?,?)"
	QUERY_AddControlGroup = "INSERT into control_group" +
		"(" +
		"campaign_id,attributes,bloom_filter" +
		") " +
		"values (?,?,?)"
	QUERY_FindTargetUserById = "SELECT id,campaign_id,user_id,user_type,attributes " +
		"FROM target_users " +
		"WHERE campaign_id = ?"

	QUERY_AddInactionTargetUser = "INSERT into inaction_target_users" +
		"(" +
		"campaign_id, user_id, user_type" +
		") " +
		"values(?,?,?)"
	QUERY_FindInactionTargetUserByCampaignId = "SELECT id,campaign_id,user_id,user_type " +
		"FROM inaction_target_users " +
		"WHERE campaign_id = ?"
	QUERY_FindQueryCampaign                             = "SELECT name, query FROM campaign_query WHERE type = ?;"
	QUERY_AddQueryCampaign                              = "INSERT INTO campaign_query(name, type, query, updated_by) VALUES(?,?,?,?);"
	QUERY_AddUserJourneyVertex                          = "" /* 137-byte string literal not displayed */
	QUERY_AddEdge                                       = "" /* 152-byte string literal not displayed */
	QUERY_AddEngagementVertex                           = "INSERT INTO engagement_vertices(campaign_id,template_name,attributes,athena_query,channel) VALUES(?,?,?,?,?)"
	QUERY_FindUserJourneyVerticesByCampaignId           = "" /* 205-byte string literal not displayed */
	QUERY_FindEdgesByCampaignId                         = "" /* 236-byte string literal not displayed */
	QUERY_FindEngagementVerticesByCampaignId            = "" /* 178-byte string literal not displayed */
	QUERY_FindEngagementVerticesById                    = "" /* 169-byte string literal not displayed */
	QUERY_AddUserJourneyTargetUsers                     = "" /* 147-byte string literal not displayed */
	QUERY_FindStartEngagementVertexId                   = "SELECT id FROM engagement_vertices WHERE campaign_id = ? AND deleted_at is NULL ORDER BY id LIMIT 1"
	QUERY_FindPreviosEngagementVertexId                 = "" /* 153-byte string literal not displayed */
	QUERY_FindNextEngaagementVertexId                   = "" /* 187-byte string literal not displayed */
	QUERY_GetPreviousEngagementTargetUsers              = "" /* 234-byte string literal not displayed */
	QUERY_UpdateCampaign_CronExpression_Status_MetaData = "UPDATE campaigns SET cron_expression = ?,status = ?,attributes = ? where id = ?"
	QUERY_DeleteUserJourneyVerticesByCampaignId         = "UPDATE user_journey_vertices SET deleted_at = CURRENT_TIMESTAMP() WHERE campaign_id = ? AND deleted_at is NULL"
	QUERY_DeleteEngagementVerticesByCampaignId          = "UPDATE engagement_vertices SET deleted_at = CURRENT_TIMESTAMP() WHERE campaign_id = ? AND deleted_at is NULL"
	QUERY_DeleteEdgesByCampaignId                       = "UPDATE edges SET deleted_at = CURRENT_TIMESTAMP() WHERE campaign_id = ? AND vertex_type = ? AND deleted_at is NULL"
)

Variables

View Source
var (
	QUERY_GetDynamicDataByKey = "SELECT campaign_id, dynamic_key, cta_link, media FROM dynamic_media WHERE campaign_id = ? and dynamic_key = ?;"

	QUERY_AddDynamicData                       = "insert into dynamic_media(campaign_id, dynamic_key, cta_link, media) values(?,?,?,?)"
	QUERY_DISTINCT_USERS                       = "SELECT DISTINCT(user_type) FROM (@query@)"
	QUERY_ATHENA_SMS_ATTRIBUTES                = ""
	QUERY_ATHENA_APP_NOTIFICATION_ATTRIBUTES   = ""
	QUERY_ATHENA_WHATSAPP_ATTRIBUTES           = ""
	QUERY_ATHENA_EMAIL_ATTRIBUTES              = ""
	QUERY_USERLIST_SMS_ATTRIBUTES              = ""
	QUERY_USERLIST_APP_NOTIFICATION_ATTRIBUTES = ""
	QUERY_USERLIST_WHATSAPP_ATTRIBUTES         = ""
	QUERY_USERLIST_EMAIL_ATTRIBUTES            = ""
)

Functions

func GenerateFilterCampaignsQuery

func GenerateFilterCampaignsQuery(request *fs.FilterCampaignRequest) (string, []interface{})

func GenerateFilterUserJourneyCampaignsQuery

func GenerateFilterUserJourneyCampaignsQuery(request *fs.FilterUserJourneyCampaignRequest, startTime time.Time, endTime time.Time) (string, []interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL