This package models Xero data from Fivetran's connector. It uses data in the format described by this ERD.
This package contains staging models, designed to work simultaneously with our Xero modeling package. The staging models name columns consistently across all packages:
- Boolean fields are prefixed with
is_
orhas_
. - ID primary keys are prefixed with the name of the table. For example, the campaign table's ID column is renamed
campaign_id
.
Check dbt Hub for the latest installation instructions, or read the dbt docs for more information on installing packages.
Include in your packages.yml
packages:
- package: fivetran/xero_source
version: [">=0.4.0", "<0.5.0"]
By default, this package will look for your Xero data in the xero
schema of your target database. If this is not where your Xero data is, add the following configuration to your dbt_project.yml
file:
# dbt_project.yml
...
config-version: 2
vars:
xero_schema: your_schema_name
xero_database: your_database_name
If you have multiple Xero connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the source_relation
column of each model. To use this functionality, you will need to set either (note that you cannot use both) the union_schemas
or union_databases
variables:
# dbt_project.yml
...
config-version: 2
vars:
xero_source:
union_schemas: ['xero_us','xero_ca'] # use this if the data is in different schemas/datasets of the same database/project
union_databases: ['xero_us','xero_ca'] # use this if the data is in different databases/projects but uses the same schema name
When setting up your Xero connection in Fivetran, it is possible that not every table this package expects will be synced. This can occur because you either don't use that functionality in Xero or have actively decided to not sync some tables. In order to disable the relevant functionality in the package, you will need to add the relevant variables.
By default, all variables are assumed to be true
. You only need to add variables for the tables you would like to disable:
# dbt_project.yml
config-version: 2
vars:
xero__using_credit_note: false # default is true
Don't see a model or specific metric you would have liked to be included? Notice any bugs when installing
and running the package? If so, we highly encourage and welcome contributions to this package!
Please create issues or open PRs against main
. See the Discourse post for information on how to contribute to a package.
This package has been tested on BigQuery, Snowflake, Postgres and Redshift.
- Provide feedback on our existing dbt packages or what you'd like to see next
- Have questions, feedback, or need help? Book a time during our office hours using Calendly or email us at [email protected]
- Find all of Fivetran's pre-built dbt packages in our dbt hub
- Learn how to orchestrate dbt transformations with Fivetran
- Learn more about Fivetran overall in our docs
- Check out Fivetran's blog
- Learn more about dbt in the dbt docs
- Check out Discourse for commonly asked questions and answers
- Join the chat on Slack for live discussions and support
- Find dbt events near you
- Check out the dbt blog for the latest news on dbt's development and best practices