Skip to content
Open
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
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
with:
go-version-file: 'go.mod'
cache: true
- name: Install ODBC build dependencies
if: startsWith(matrix.platform, 'depot-ubuntu')
run: sudo apt-get update && sudo apt-get install -y unixodbc-dev
- name: Run test suite
run: make ${{ matrix.suite }}

Expand Down Expand Up @@ -74,7 +77,7 @@ jobs:
- name: Run GoReleaser
if: steps.cache.outputs.cache-hit != 'true'
run: |
docker run --privileged -v /var/run/docker.sock:/var/run/docker.sock -e GGOOS=linux -e GORELEASER_KEY=${{ secrets.GORELEASER_KEY }} -e COMMIT_SHA=${{ github.sha }} -e VERSION=${{ github.ref_name }} -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} -v $(pwd):/src -w /src goreleaser/goreleaser-cross-pro:v1.23 release --clean --split --verbose
docker run --privileged -v /var/run/docker.sock:/var/run/docker.sock -e GGOOS=linux -e GORELEASER_KEY=${{ secrets.GORELEASER_KEY }} -e COMMIT_SHA=${{ github.sha }} -e VERSION=${{ github.ref_name }} -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} -v $(pwd):/src -w /src goreleaser/goreleaser-cross-pro:v1.23 sh -lc "apt-get update && apt-get install -y unixodbc-dev && goreleaser release --clean --split --verbose"


release-unix:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install ODBC build dependencies
run: sudo apt-get update && sudo apt-get install -y unixodbc-dev

- name: Setup Go
uses: actions/setup-go@v6
with:
Expand All @@ -56,6 +59,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install ODBC build dependencies
run: sudo apt-get update && sudo apt-get install -y unixodbc-dev

- name: Pre-pull testcontainer images (background)
run: |
# Pull in parallel with go-test compilation; testcontainers will
Expand Down Expand Up @@ -113,6 +119,8 @@ jobs:
runs-on: depot-ubuntu-24.04-4
steps:
- uses: actions/checkout@v4
- name: Install ODBC build dependencies
run: sudo apt-get update && sudo apt-get install -y unixodbc-dev
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
Expand All @@ -126,6 +134,8 @@ jobs:
runs-on: depot-ubuntu-24.04-4
steps:
- uses: actions/checkout@v4
- name: Install ODBC build dependencies
run: sudo apt-get update && sudo apt-get install -y unixodbc-dev
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
libc6-dev \
unixodbc-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /src
Expand Down Expand Up @@ -39,6 +40,7 @@ FROM debian:bookworm-slim
# Install minimal runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
unixodbc \
&& rm -rf /var/lib/apt/lists/*

# Create non-root user for security
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ Pull requests are welcome. However, please open an issue first to discuss what y
<td>✅</td>
<td>-</td>
</tr>
<tr>
<td>NetSuite</td>
<td>✅</td>
<td>-</td>
</tr>
<tr>
<td>Notion</td>
<td>✅</td>
Expand Down
33 changes: 33 additions & 0 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4227,6 +4227,39 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


===============================================================================
github.com/alexbrainman/odbc/LICENSE
===============================================================================

Copyright (c) 2012 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


===============================================================================
github.com/andybalholm/brotli/LICENSE
===============================================================================
Expand Down
111 changes: 111 additions & 0 deletions docs/supported-sources/netsuite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# NetSuite

[NetSuite](https://www.netsuite.com/) is a cloud ERP platform from Oracle.

ingestr supports NetSuite as a source through **SuiteAnalytics Connect ODBC**, the SQL interface used by tools such as Fivetran's NetSuite SuiteAnalytics connector. The connector targets the `NetSuite2.com` data source by default.

## Prerequisites

Before using this source, your NetSuite administrator must:

- Enable SuiteAnalytics Connect in NetSuite.
- Download and install the NetSuite ODBC driver on the machine or Docker image running ingestr.
- Create or select a role with SuiteAnalytics Connect permissions.
- Note the account ID and role internal ID.

The NetSuite ODBC driver is proprietary and account-provided, so ingestr does not bundle it. On Linux containers, install unixODBC and the NetSuite ODBC driver, then either configure a DSN in `odbc.ini`/`odbcinst.ini` or pass a full ODBC connection string in the source URI.

## URI Format

The most flexible option is to pass the ODBC connection string directly:

```text
netsuite://?odbc_connect_string=DRIVER%3D%7BNetSuite%20ODBC%20Drivers%2064bit%7D%3BHost%3D123456.connect.api.netsuite.com%3BPort%3D1708%3BEncrypted%3D1%3BAllowSinglePacketLogout%3D1%3BSDSN%3DNetSuite2.com%3BUID%3Duser%40example.com%3BPWD%3Dsecret%3BCustomProperties%3D%7BAccountID%3D123456%3BRoleID%3D57%7D%3B
```

You can also reference a configured DSN:

```text
netsuite://?dsn=NetSuite2&username=<email>&password=<password_or_token_password>
```

Or build a DSN-less connection string from URI parameters:

```text
netsuite://<account_id>?driver=NetSuite+ODBC+Drivers+64bit&role_id=<role_id>&username=<email>&password=<password_or_token_password>
```

URI parameters:

- `odbc_connect_string`: Full ODBC connection string. `connection_string` and `conn_str` are accepted as aliases.
- `dsn`: ODBC DSN name from `odbc.ini`.
- `driver` or `driver_name`: Installed ODBC driver name for DSN-less connections, for example `NetSuite ODBC Drivers 64bit`.
- `account_id`: NetSuite account ID. Sandbox IDs such as `123456_SB1` are supported; ingestr derives the Connect host as `123456-sb1.connect.api.netsuite.com`.
- `role_id`: Internal ID of the NetSuite role used for SuiteAnalytics Connect.
- `username` or `user`: NetSuite login email. URI user info is also accepted.
- `password`: NetSuite password, or token password if your account uses token-based SuiteAnalytics Connect authentication.
- `token_password`: Alias for `password`.
- `host`: Optional SuiteAnalytics Connect service host override.
- `port`: Optional Connect port. Defaults to `1708`.
- `server_data_source` or `sdsn`: Optional data source. Defaults to `NetSuite2.com`.
- `encrypted`: Optional ODBC encryption setting. Defaults to `1`.
- `allow_single_packet_logout`: Optional ODBC logout setting. Defaults to `1`.
- `truststore`: Optional path or comma-separated certificate list for the NetSuite ODBC driver.
- `static_schema=true`: Adds `StaticSchema=1` to ODBC custom properties.
- `uppercase=true`: Adds `Uppercase=1` to ODBC custom properties.
- `custom_properties`: Additional semicolon-separated ODBC custom properties.

The DSN-less connection string generated by ingestr has this shape:

```text
DRIVER={NetSuite ODBC Drivers 64bit};Host=<account>.connect.api.netsuite.com;Port=1708;Encrypted=1;AllowSinglePacketLogout=1;SDSN=NetSuite2.com;UID=<email>;PWD=<password>;CustomProperties={AccountID=<account_id>;RoleID=<role_id>};
```

## Examples

Load the `customer` table into DuckDB using a DSN:

```bash
ingestr ingest \
--source-uri "netsuite://?dsn=${NETSUITE_DSN}&username=${NETSUITE_USERNAME}&password=${NETSUITE_PASSWORD}" \
--source-table "customer" \
--dest-uri "duckdb:///netsuite.duckdb" \
--dest-table "main.netsuite_customers"
```

Load the `customer` table using DSN-less driver parameters:

```bash
ingestr ingest \
--source-uri "netsuite://?driver=${NETSUITE_ODBC_DRIVER}&account_id=${NETSUITE_ACCOUNT_ID}&role_id=${NETSUITE_ROLE_ID}&username=${NETSUITE_USERNAME}&password=${NETSUITE_PASSWORD}" \
--source-table "customer" \
--dest-uri "duckdb:///netsuite.duckdb" \
--dest-table "main.netsuite_customers"
```

Use a custom SQL query:

```bash
ingestr ingest \
--source-uri "netsuite://?dsn=${NETSUITE_DSN}&username=${NETSUITE_USERNAME}&password=${NETSUITE_PASSWORD}" \
--source-table "query:SELECT id, entityid, email FROM customer" \
--dest-uri "duckdb:///netsuite.duckdb" \
--dest-table "main.netsuite_customer_emails"
```

Use interval filtering by passing an incremental key:

```bash
ingestr ingest \
--source-uri "netsuite://?driver=${NETSUITE_ODBC_DRIVER}&account_id=${NETSUITE_ACCOUNT_ID}&role_id=${NETSUITE_ROLE_ID}&username=${NETSUITE_USERNAME}&password=${NETSUITE_PASSWORD}" \
--source-table "transaction" \
--incremental-key "lastmodifieddate" \
--interval-start "2026-01-01T00:00:00Z" \
--interval-end "2026-02-01T00:00:00Z" \
--dest-uri "duckdb:///netsuite.duckdb" \
--dest-table "main.netsuite_transactions"
```

For plain table names, ingestr runs `SELECT * FROM <source-table>` through SuiteAnalytics Connect. For joins, selected columns, functions, or aliases, use the `query:` source-table form.

SuiteAnalytics Connect schemas vary by account, role, and NetSuite data source, so ingestr infers the destination schema from extracted rows.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ require (
cloud.google.com/go/bigquery v1.72.0
cloud.google.com/go/spanner v1.87.0
cloud.google.com/go/storage v1.56.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.3
github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake v1.4.4
github.com/ClickHouse/clickhouse-go/v2 v2.42.0
github.com/InfluxCommunity/influxdb3-go/v2 v2.13.0
github.com/SAP/go-hdb v1.16.2
github.com/alecthomas/chroma/v2 v2.23.1
github.com/alexbrainman/odbc v0.0.0-20250601004241-49e6b2bc0cf0
github.com/apache/arrow-adbc/go/adbc v1.9.0
github.com/apache/arrow-go/v18 v18.5.1
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
Expand Down Expand Up @@ -96,7 +98,6 @@ require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ github.com/alecthomas/chroma/v2 v2.23.1 h1:nv2AVZdTyClGbVQkIzlDm/rnhk1E9bU9nXwmZ
github.com/alecthomas/chroma/v2 v2.23.1/go.mod h1:NqVhfBR0lte5Ouh3DcthuUCTUpDC9cxBOfyMbMQPs3o=
github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs=
github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alexbrainman/odbc v0.0.0-20250601004241-49e6b2bc0cf0 h1:gUrYWktqvF8PVb2SIBQR5WsFxjctn7d1JBIx/FrSzik=
github.com/alexbrainman/odbc v0.0.0-20250601004241-49e6b2bc0cf0/go.mod h1:c5eyz5amZqTKvY3ipqerFO/74a/8CYmXOahSr40c+Ww=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
Expand Down Expand Up @@ -950,6 +952,7 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
Expand Down
4 changes: 4 additions & 0 deletions pkg/source/avro/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func TestAvroSource_RegistryLookup(t *testing.T) {
}

func TestAvroSource_ToDuckDBViaPipeline(t *testing.T) {
if testing.Short() {
t.Skip("skipping pipeline-to-DuckDB integration test in short mode")
}

t.Parallel()

ctx := context.Background()
Expand Down
Loading
Loading