Build Data Flows from Linear to SQL Server using SSIS
Using SQL Server as a backup for critical business data provides an essential safety net against loss. Backing up data to SQL Server enables business users to more easily connect that data with features like reporting, analytics, and more.
This example demonstrates how to use the CData SSIS Tasks for Linear inside of a SQL Server SSIS workflow to transfer Linear data into a Microsoft SQL Server database.
Add the Components
To get started, add a new Linear source and SQL Server ADO.NET destination to a new data flow task.
Create a New Connection Manager
Follow the steps below to save Linear connection properties in a connection manager.
- In the Connection Manager window, right-click and then click New Connection. The Add SSIS Connection Manager dialog is displayed.
- In the Connection Manager type menu, select Linear. The CData Linear Connection Manager is displayed.
- Configure connection properties.
You can authenticate to Linear with a personal API key or with OAuth 2.0. The API key is the simplest option for connecting with your own Linear account.
Authenticating with an API Key
Set the following connection properties:
- AuthScheme: Set this to APIKey.
- APIKey: A Linear personal API key.
To create a personal API key, log in to Linear, open Settings > Security & access > Personal API keys, select New API key, and create it. Copy the key immediately, because Linear shows it only once.
Authenticating with OAuth
OAuth requires a custom OAuth application registered in Linear (Settings > API > OAuth applications), which provides the OAuthClientId and OAuthClientSecret. Two flows are supported:
- Authorization code: Set AuthScheme to OAuth, InitiateOAuth to GETANDREFRESH, and provide OAuthClientId, OAuthClientSecret, and the CallbackURL defined in your application (e.g., http://localhost:33333). The driver opens Linear in your browser so you can grant access.
- Client credentials: Set AuthScheme to OAuthClient and provide OAuthClientId and OAuthClientSecret. This authenticates the application itself, with no browser interaction, and suits machine-to-machine integrations.
By default, the driver requests the read,write scopes. The driver refreshes the access token automatically when it expires.
Configure the Linear Source
Follow the steps below to specify the query to be used to extract Linear data.
- Double-click the Linear source to open the source component editor.
- In the Connection Manager menu, select the connection manager previously created.
- Specify the query to use for the data extraction. For example:
SELECT id, name FROM Team WHERE key = 'ENG'
- Close the Linear Source control and connect it to the ADO.NET Destination.
Configure the SQL Server Destination
Follow the steps below to specify the SQL server table to load the Linear data into.
- Open the ADO.NET Destination and add a New Connection. Enter your server and database information here.
- In the Data access mode menu, select "table or view".
- In the Table Or View menu, select the table or view to populate.
- Configure any properties you wish to on the Mappings screen.
Run the Project
You can now run the project. After the SSIS Task has finished executing, your database will be populated with Linear data.