Skip to content

Instantly share code, notes, and snippets.

View yai333's full-sized avatar

Yi Ai yai333

  • Melbourne
View GitHub Profile
@yai333
yai333 / init.sql
Created January 27, 2024 02:44
init
-- Create publication
CREATE PUBLICATION gcp_pub_cdc
FOR TABLE public.customers, public.orderdetails,
public.orders, public.products;
-- Create Publication slot
SELECT PG_CREATE_LOGICAL_REPLICATION_SLOT('gcp_pub_cdc_slot', 'pgoutput');
-- Create db user for Datastream
{
"name": "[concat(parameters('factoryName'), '/DemoPipeline')]",
"type": "Microsoft.DataFactory/factories/pipelines",
"apiVersion": "2018-06-01",
"properties": {
"activities": [
{
"name": "ExtractCalendarView",
"description": "Get the occurrences, exceptions of events in a calendar view defined by a time range",
"type": "Copy",
{
"annotations": [],
"type": "AzureDatabricks",
"typeProperties": {
"domain": "https://adb-852436302xxxxx.1.azuredatabricks.net",
"authentication": "MSI",
"workspaceResourceId": "/subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourceGroups/topscope-dev/providers/Microsoft.Databricks/workspaces/demo",
"newClusterNodeType": "Standard_DS3_v2",
"newClusterNumOfWorker": "1",
"newClusterSparkEnvVars": {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"name":"demoPipeline",
"type":"Microsoft.DataFactory/factories/pipelines",
"apiVersion":"2018-06-01",
"properties":{
"activities":[
{
"name":"ExtractCalendarView",
"description":"Get the occurrences, exceptions of events in a calendar view defined by a time range",
"type":"Copy",
{
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
},
"parameters": {
"outputPath": {
"type": "string"
}
},
{
"linkedServiceName": {
"referenceName": "CalendarViewTable",
"type": "LinkedServiceReference"
},
"annotations": [],
"type": "Office365Table",
"schema": [],
"typeProperties": {
"tableName": "BasicDataSet_v0.CalendarView_v0"
{
"annotations": [],
"type": "Office365",
"typeProperties": {
"office365TenantId": "TENARNT_ID",
"servicePrincipalTenantId": "TENARNT_ID",
"servicePrincipalId": "APP_CLIENT_ID",
"servicePrincipalKey": {
"type": "SecureString",
"value": "APP_CLIENT_SECRET"
@yai333
yai333 / azureStorageLinkedService.json
Last active November 18, 2021 05:57
azureStorageLinkedService.json
{
"annotations": [],
"type": "AzureBlobStorage",
"typeProperties": {
"serviceEndpoint": "https://YOUR_CONTAINER.blob.core.windows.net",
"tenant": "TENANT_ID",
"servicePrincipalId": "APP_CLIENT_ID",
"servicePrincipalKey": {
"type": "SecureString",
"value": "APP_CLIENT_SECRET"
const { data } = await axios.post(
"/login",
{
address,
signature,
},
{
headers: {
'Content-Type': 'application/json',
},