Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

feat!: Update to SDK V3 Arrow native #9

Merged
merged 3 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"strings"

"github.com/cloudquery/plugin-sdk/plugins/source"
"github.com/cloudquery/plugin-sdk/schema"
"github.com/cloudquery/plugin-sdk/specs"
"github.com/cloudquery/plugin-pb-go/specs"
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
"github.com/cloudquery/plugin-sdk/v3/schema"
"github.com/hashicorp/go-retryablehttp"
"github.com/plaid/plaid-go/v10/plaid"
"github.com/rs/zerolog"
Expand Down
2 changes: 1 addition & 1 deletion client/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/cloudquery/plugin-sdk/schema"
"github.com/cloudquery/plugin-sdk/v3/schema"
"github.com/plaid/plaid-go/v10/plaid"
"github.com/thoas/go-funk"
)
Expand Down
6 changes: 3 additions & 3 deletions client/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"testing"
"time"

"github.com/cloudquery/plugin-sdk/plugins/source"
"github.com/cloudquery/plugin-sdk/schema"
"github.com/cloudquery/plugin-sdk/specs"
"github.com/cloudquery/plugin-pb-go/specs"
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
"github.com/cloudquery/plugin-sdk/v3/schema"
"github.com/plaid/plaid-go/v10/plaid"
"github.com/rs/zerolog"
)
Expand Down
11 changes: 6 additions & 5 deletions client/transformers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package client
import (
"reflect"

"github.com/cloudquery/plugin-sdk/schema"
"github.com/cloudquery/plugin-sdk/transformers"
"github.com/apache/arrow/go/v13/arrow"
"github.com/cloudquery/plugin-sdk/v3/schema"
"github.com/cloudquery/plugin-sdk/v3/transformers"
"github.com/plaid/plaid-go/v10/plaid"
)

func typeTransformer(field reflect.StructField) (schema.ValueType, error) {
func typeTransformer(field reflect.StructField) (arrow.DataType, error) {
switch reflect.New(field.Type).Elem().Interface().(type) {
case plaid.NullableTime:
return schema.TypeTimestamp, nil
return arrow.FixedWidthTypes.Timestamp_us, nil
default:
return schema.TypeInvalid, nil
return nil, nil
}
}

Expand Down
20 changes: 11 additions & 9 deletions docs/tables/plaid_account_balances.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Table: plaid_account_balances

This table shows data for Plaid Account Balances.

The primary key for this table is **item_id**.

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|item_id (PK)|String|
|accounts|JSON|
|item|JSON|
|request_id|String|
|additional_properties|JSON|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|item_id (PK)|`utf8`|
|accounts|`json`|
|item|`json`|
|request_id|`utf8`|
|additional_properties|`json`|
22 changes: 12 additions & 10 deletions docs/tables/plaid_auths.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Table: plaid_auths

This table shows data for Plaid Auths.

The primary key for this table is **item_id**.

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|item_id (PK)|String|
|accounts|JSON|
|numbers|JSON|
|item|JSON|
|request_id|String|
|additional_properties|JSON|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|item_id (PK)|`utf8`|
|accounts|`json`|
|numbers|`json`|
|item|`json`|
|request_id|`utf8`|
|additional_properties|`json`|
20 changes: 11 additions & 9 deletions docs/tables/plaid_identities.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Table: plaid_identities

This table shows data for Plaid Identities.

The primary key for this table is **item_id**.

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|item_id (PK)|String|
|accounts|JSON|
|item|JSON|
|request_id|String|
|additional_properties|JSON|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|item_id (PK)|`utf8`|
|accounts|`json`|
|item|`json`|
|request_id|`utf8`|
|additional_properties|`json`|
36 changes: 19 additions & 17 deletions docs/tables/plaid_institutions.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# Table: plaid_institutions

This table shows data for Plaid Institutions.

The primary key for this table is **institution_id**.

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|institution_id (PK)|String|
|name|String|
|products|StringArray|
|country_codes|StringArray|
|url|JSON|
|primary_color|JSON|
|logo|JSON|
|routing_numbers|StringArray|
|oauth|Bool|
|status|JSON|
|payment_initiation_metadata|JSON|
|auth_metadata|JSON|
|additional_properties|JSON|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|institution_id (PK)|`utf8`|
|name|`utf8`|
|products|`list<item: utf8, nullable>`|
|country_codes|`list<item: utf8, nullable>`|
|url|`json`|
|primary_color|`json`|
|logo|`json`|
|routing_numbers|`list<item: utf8, nullable>`|
|oauth|`bool`|
|status|`json`|
|payment_initiation_metadata|`json`|
|auth_metadata|`json`|
|additional_properties|`json`|
24 changes: 13 additions & 11 deletions docs/tables/plaid_investments_holdings.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Table: plaid_investments_holdings

This table shows data for Plaid Investments Holdings.

The primary key for this table is **item_id**.

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|item_id (PK)|String|
|accounts|JSON|
|holdings|JSON|
|securities|JSON|
|item|JSON|
|request_id|String|
|additional_properties|JSON|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|item_id (PK)|`utf8`|
|accounts|`json`|
|holdings|`json`|
|securities|`json`|
|item|`json`|
|request_id|`utf8`|
|additional_properties|`json`|
26 changes: 14 additions & 12 deletions docs/tables/plaid_investments_transactions.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Table: plaid_investments_transactions

This table shows data for Plaid Investments Transactions.

The primary key for this table is **item_id**.

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|item_id (PK)|String|
|item|JSON|
|accounts|JSON|
|securities|JSON|
|investment_transactions|JSON|
|total_investment_transactions|Int|
|request_id|String|
|additional_properties|JSON|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|item_id (PK)|`utf8`|
|item|`json`|
|accounts|`json`|
|securities|`json`|
|investment_transactions|`json`|
|total_investment_transactions|`int64`|
|request_id|`utf8`|
|additional_properties|`json`|
22 changes: 12 additions & 10 deletions docs/tables/plaid_liabilities.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Table: plaid_liabilities

This table shows data for Plaid Liabilities.

The primary key for this table is **item_id**.

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|item_id (PK)|String|
|accounts|JSON|
|item|JSON|
|liabilities|JSON|
|request_id|String|
|additional_properties|JSON|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|item_id (PK)|`utf8`|
|accounts|`json`|
|item|`json`|
|liabilities|`json`|
|request_id|`utf8`|
|additional_properties|`json`|
68 changes: 35 additions & 33 deletions docs/tables/plaid_transactions.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
# Table: plaid_transactions

This table shows data for Plaid Transactions.

The composite primary key for this table is (**transaction_type**, **transaction_id**, **_transaction_type**).

## Columns

| Name | Type |
| ------------- | ------------- |
|_cq_source_name|String|
|_cq_sync_time|Timestamp|
|_cq_id|UUID|
|_cq_parent_id|UUID|
|transaction_type (PK)|String|
|pending_transaction_id|JSON|
|category_id|JSON|
|category|StringArray|
|location|JSON|
|payment_meta|JSON|
|account_owner|JSON|
|name|String|
|original_description|JSON|
|account_id|String|
|amount|Float|
|iso_currency_code|JSON|
|unofficial_currency_code|JSON|
|date|String|
|pending|Bool|
|transaction_id (PK)|String|
|merchant_name|JSON|
|logo_url|JSON|
|website|JSON|
|check_number|JSON|
|payment_channel|String|
|authorized_date|JSON|
|authorized_datetime|Timestamp|
|datetime|Timestamp|
|transaction_code|JSON|
|personal_finance_category|JSON|
|personal_finance_category_icon_url|String|
|counterparties|JSON|
|_transaction_type (PK)|String|
|_cq_source_name|`utf8`|
|_cq_sync_time|`timestamp[us, tz=UTC]`|
|_cq_id|`uuid`|
|_cq_parent_id|`uuid`|
|transaction_type (PK)|`utf8`|
|pending_transaction_id|`json`|
|category_id|`json`|
|category|`list<item: utf8, nullable>`|
|location|`json`|
|payment_meta|`json`|
|account_owner|`json`|
|name|`utf8`|
|original_description|`json`|
|account_id|`utf8`|
|amount|`float64`|
|iso_currency_code|`json`|
|unofficial_currency_code|`json`|
|date|`utf8`|
|pending|`bool`|
|transaction_id (PK)|`utf8`|
|merchant_name|`json`|
|logo_url|`json`|
|website|`json`|
|check_number|`json`|
|payment_channel|`utf8`|
|authorized_date|`json`|
|authorized_datetime|`timestamp[us, tz=UTC]`|
|datetime|`timestamp[us, tz=UTC]`|
|transaction_code|`json`|
|personal_finance_category|`json`|
|personal_finance_category_icon_url|`utf8`|
|counterparties|`json`|
|_transaction_type (PK)|`utf8`|
Loading