Babelfish
Babelfish provides a PostgreSQL-backed database endpoint with Microsoft TDS compatibility, which makes it suitable for workloads and tooling that expect SQL Server semantics.
| Property | Value | Notes |
|---|---|---|
| Provider name | babelfish | Use this in landscape provider definitions. |
| Version | v1 | Current schema version exposed by the provider. |
| Category | Database | Shown in the managed services catalog. |
| Scope | global | Available at team scope rather than being tied to a single workspace runtime. |
| Team singleton | false | Teams can create multiple Babelfish service instances. |
| Pause support | true | This provider supports pausing. |
Preview Feature
This provider is currently a preview feature. It is not enabled by default and needs to be enabled by your operator. As a preview, the provider is still evolving, its schema, plans, and behavior may change in the future.
Capabilities
| Capability | Supported | Notes |
|---|---|---|
| Backups | ✅ | Backups are stored in the object store as native PostgreSQL physical backups, utilizing the standard PostgreSQL storage architecture. |
| Point-in-time recovery | ✅ | The database can be restored to a specific point in time. |
Good to know
- High availability is not yet available; the service runs as a single instance.
- Upgrades are never applied automatically. Manual minor version upgrades are supported via the
versionconfig field. - Storage does not grow automatically, but you can increase the
storageplan parameter manually at any time.
Architecture
Under the hood, a Babelfish service is the same managed PostgreSQL setup as the PostgreSQL provider — a dedicated PostgreSQL server powered by the CloudNativePG operator — with the Babelfish for PostgreSQL extensions installed and enabled. Babelfish adds a T-SQL dialect and a Microsoft TDS wire-protocol endpoint on port 1433, so SQL Server clients and drivers can connect directly.
- Pinned version pairs: The
versionconfig field pins a compatible pair of PostgreSQL and Babelfish versions — for example,17.6-5.3.0is PostgreSQL 17.6 with Babelfish 5.3.0. - Shared foundation: Storage (replicated Ceph block storage), networking, and the backup mechanism are identical to the PostgreSQL provider.
Schema
Config
| Field | Type | Required on create | Notes |
|---|---|---|---|
version | string | No | Combined PostgreSQL and Babelfish version. Default: 17.6-5.3.0. Allowed values: 17.7-5.4.0, 16.11-4.8.0, 17.6-5.3.0, 16.10-4.7.0. Minor upgrades only. |
Secrets
| Field | Type | Required on create | Notes |
|---|---|---|---|
superuserPassword | string | Yes | Password for the administrative database user. |
Details / Output
| Field | Type | Availability | Notes |
|---|---|---|---|
hostname | string | Exposed after provisioning | Internal service hostname. |
port | integer | Exposed after provisioning | TDS port. |
dsn | string | Exposed after provisioning | TDS connection string for the superuser against the master database. |
ready | boolean | Exposed after provisioning | Indicates whether the instance is ready for connections. |
Plan
The provider exposes one plan, Small (id: 0).
Example plan: Small (id: 0).
| Parameter | Type | Default | Minimum | Maximum | Static | Notes |
|---|---|---|---|---|---|---|
cpu | number | 1 | - | - | Yes | Priced as cpu-tenths. |
memory | integer | 128 | - | - | Yes | Priced as ram-mib. |
storage | integer | 1024 | 512 | - | No | Priced as storage-mib. |
Example in a Landscape
schemaVersion: v0.2
run:
sqlserver-compatible-db:
provider:
name: babelfish
version: v1
plan:
id: 0
parameters:
storage: 2048
config:
version: "17.7-5.4.0"
secrets:
superuserPassword: "${{ vault.babelfishSuperuserPassword }}"
Within other runtimes, use the returned dsn directly with SQL Server compatible drivers, or use hostname and port with 1433-compatible tooling.
That same internal endpoint is reachable from other Codesphere runtimes, including reactives, managed containers, and Virtual Cluster workloads.
Connecting to a Babelfish DB
Prerequisites
Once your Babelfish DB is deployed, you can connect to it from your Codesphere workspaces.
Each service lists non-sensitive connection details in their respective settings page, in the overview tab (or in the details property in the public API payload).
info
Before connecting, make sure the service is synchronized and running: in the service settings, ready must be true.
Connecting via Terminal (tsql)
You can use tsql (part of the FreeTDS package) to connect.
Note that tsql might need to be installed in your workspace.
# Install FreeTDS
nix-env -iA nixpkgs.freetds
# Syntax
TDSENCRYPTION=required tsql -H <hostname> -p 1433 -U <username> -D <database>
# Example
TDSENCRYPTION=required tsql -H ms-babelfish-v1-123-my-server.ms-postgres -p 1433 -U postgres -D master
Connecting via Node.js
Using the mssql library:
const sql = require('mssql');
(async () => {
const config = {
user: 'postgres',
password: 'superSecret',
server: 'ms-babelfish-v1-123-my-server.ms-postgres',
port: 1433,
database: 'master',
options: {
encrypt: true,
trustServerCertificate: false
}
};
await sql.connect(config);
const result = await sql.query`SELECT 1 as val`;
console.log(result.recordset[0].val);
})();
Backups
Since the underlying engine of a Babelfish service is a regular PostgreSQL server, backups work exactly like backups of the PostgreSQL provider: the CloudNativePG Barman Cloud plugin stores native PostgreSQL physical backups in your S3-compatible backup store and continuously archives the write-ahead log, enabling point-in-time recovery.
Configuration, recovery, required S3 permissions, and limitations are identical to PostgreSQL — see the PostgreSQL backup documentation for examples.