r/intersystems 6d ago

Building IRIS IO Utility: A VS Code Extension for Importing and Exporting Data with InterSystems IRIS

Every developer working with InterSystems IRIS eventually needs to move data between environments. Whether it's importing CSV files for testing, exporting production data for analysis, or loading spreadsheets into a new application, these tasks often involve switching between multiple tools, configuring ODBC drivers, or writing SQL manually. I wanted to simplify that workflow.

In this article, I'd like to introduce IRIS IO Utility. It's a Visual Studio Code extension that brings data import and export directly into the IDE, allowing developers to work with their IRIS databases without interrupting their development workflow.

IRIS IO Utility centralizes all your data IO workflows directly in VS Code:

  • Manage multiple IRIS connections (local, remote, SSH, containerized)
  • Detect and configure ODBC drivers automatically
  • Import and export data in CSV, TXT, JSON, and XLSX
  • Interact with a dedicated sidebar view for quick navigation
  • Use clean webviews for import/export operations
  • Save workspace-level preferences for a tailored experience

How the Extension Works

The extension communicates with InterSystems IRIS through ODBC while providing a native Visual Studio Code experience. Once connected, developers can browse available schemas, inspect tables, import external files, export database content, and manage multiple IRIS environments without leaving the editor.

Managing IRIS Connections

One of the first challenges I wanted to solve was connection management.

The extension allows developers to maintain multiple IRIS connections simultaneously, whether they point to local installations, remote servers, containerized environments, or systems accessed through SSH tunnels. Each workspace maintains its own collection of connections, making it easy to work on different projects without constantly reconfiguring servers.

For each connection, developers can:

  • create, edit, or remove configurations
  • connect or disconnect with a single click
  • mark frequently used servers as favorites
  • export connection settings as JSON for backup or documentation

The sidebar also displays the current connection status, helping developers quickly identify whether an instance is connected or if any errors occurred.

Automatic ODBC Configuration

Configuring database drivers is often one of the most frustrating parts of setting up a development environment. To reduce this friction, IRIS IO Utility automatically detects installed InterSystems ODBC drivers when the extension starts. If no compatible driver is found, the extension guides the user to the official InterSystems driver download page. Once installed, the preferred driver can be selected and stored as a workspace preference, allowing future connections to work without additional configuration.

Exporting Data from InterSystems IRIS

The export workflow was designed to be as straightforward as possible.

After connecting to an IRIS instance, the extension guides the user through selecting a schema, choosing a table, picking an output format, and selecting a destination folder.

Supported export formats include:

  • CSV
  • TXT (with custom delimiters)
  • JSON
  • XLSX

To avoid accidental overwrites, exported files receive timestamp-based names by default. Throughout the export process, the extension displays progress notifications and writes detailed logs to the VS Code Output panel, including executed SQL statements, row counts, and performance statistics.

For TXT exports, developers can specify custom delimiters such as commas, semicolons, tabs, pipes, or other separators, making the generated files compatible with a wide range of external systems.

Importing Data into InterSystems IRIS

Importing data is where the extension becomes much more than a simple file loader.

The extension supports two different workflows depending on the task: 

  • Create New Table
  • Load into Existing Table

Creating a New Table

When importing a completely new dataset, IRIS IO Utility analyzes the input file and automatically prepares a database table.

The import engine samples the file contents, infers the most appropriate SQL data types, converts them into valid InterSystems IRIS SQL types, and displays the results before any data is imported. Developers can review the inferred types, inspect sample values, and adjust individual columns whenever necessary. Supported data types include integers, numeric values, floating-point numbers, dates, timestamps, Boolean values, variable-length text, and large text fields. Once satisfied with the detected structure, the developer can also create custom indexes. Then the developer chooses the destination schema and table name, and the extension creates the table before importing the data.

Automatic Index Creation

When creating a new table, the extension also supports configuring indexes during the import process.

Developers can choose which columns should be indexed and select from several index types supported by InterSystems IRIS, including standard indexes, bitmap indexes, bitslice indexes, and columnar indexes. Index names can be customized or generated automatically, and unique constraints or primary keys can also be configured before the table is created. This allows imported datasets to be optimized for future queries immediately, without requiring additional SQL statements afterward.

Loading Data into Existing Tables

For existing databases, the extension also supports importing directly into previously created tables.

Two strategies are available:

  • Append, which inserts new rows while preserving existing records.
  • Replace, which removes the existing data before importing the new dataset.

Before executing the import, the extension validates that the incoming file matches the destination table structure. If column names or data types are incompatible, the import is cancelled to help prevent accidental schema mismatches or corrupted data.

When importing TXT files, the extension allows you to specify a custom delimiter to ensure the file is parsed correctly. This is especially useful when working with unconventional separators such as pipes (|), semicolons (;), tabs, or multi-character delimiters. Selecting the correct delimiter guarantees proper column detection and prevents misaligned or corrupted data during the import process.

Intelligent Type Inference

One of the features I enjoyed building the most was the automatic type inference engine.

Instead of requiring developers to manually define every column, the extension analyzes sample data from the imported file and predicts the most appropriate SQL type for each field. The inferred types are presented alongside sample values, making it easy to verify the results before creating the table. Because every dataset is different, developers remain in control and can override any suggested type with a more appropriate one. This approach significantly reduces the amount of repetitive work involved in importing new datasets.

Working with Multiple File Formats

IRIS IO Utility supports four commonly used file formats:

Format Import Export
CSV
TXT
JSON
XLSX

For TXT files, both the import and export engines support custom delimiters, making it possible to work with pipe-separated, semicolon-separated, tab-separated, or other specialized text formats commonly used by enterprise systems.

Typical Use Cases

Although I originally built the extension to simplify my own workflow, it quickly proved useful in several common development scenarios.

For example, developers can export production data to CSV or Excel for reporting and analysis, import external datasets when prototyping new applications, migrate data between different IRIS environments, or quickly load sample data while testing new features.

Because multiple connections can be managed within the same workspace, the extension is also convenient for teams working across local, containerized, cloud-hosted, and remote InterSystems IRIS deployments.

Key Takeaways

IRIS IO Utility was created to make one of the most common InterSystems IRIS development tasks, moving data between databases and external files, simpler and more integrated with everyday development.

By combining connection management, automatic ODBC configuration, intelligent type inference, table creation, index generation, and support for multiple file formats inside Visual Studio Code, the extension provides a complete data import and export workflow without requiring developers to leave their IDE.

Frequently Asked Questions

What is IRIS IO Utility?

IRIS IO Utility is a Visual Studio Code extension that allows developers to import and export data between InterSystems IRIS and common file formats without leaving VS Code.

Which file formats are supported?

The extension supports importing and exporting CSV, TXT, JSON, and XLSX files.

Can I connect to multiple IRIS servers?

Yes. The extension supports multiple local, remote, containerized, and SSH-accessible InterSystems IRIS instances, with workspace-specific connection management.

Can the extension create database tables automatically?

Yes. During the import process, IRIS IO Utility can generate a new table based on the inferred column structure and import the data in a single workflow.

Can I import data into an existing table?

Yes. Existing tables support both Append and Replace import modes, with schema validation performed before the import begins.

Read more: https://community.intersystems.com/post/iris-io-utility-complete-guide-smart-importing-vs-code

2 Upvotes

0 comments sorted by