or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

advanced-features.mdcontainer-management.mdcore-framework.mddatabase-testing.mdindex.mdjdbc-utilities.md
tile.json

database-testing.mddocs/

Database-Specific Testing

Specialized test suites for individual database systems with database-specific functionality testing, SQL dialect compatibility, and unique feature validation. Each database suite extends the core framework with database-specific test scenarios.

Capabilities

PostgreSQL Integration Suite

Comprehensive test suite for PostgreSQL database integration with Spark JDBC.

/**
 * PostgreSQL-specific integration test suite
 * Tests PostgreSQL-specific features and SQL dialect compatibility
 */
class PostgreSQLIntegrationSuite extends DockerJDBCIntegrationSuite {
  override val databaseType = "postgresql"
  override val databaseImage = "postgres:13"
  
  /** Test basic JDBC connectivity */
  def testBasicConnectivity(): Unit
  
  /** Test join pushdown optimization */
  def testJoinPushdown(): Unit
  
  /** Test DataSource V2 namespace operations */
  def testNamespaceOperations(): Unit
  
  /** Test PostgreSQL-specific data types */
  def testPostgreSQLDataTypes(): Unit
  
  /** Test array and JSON data types */
  def testAdvancedDataTypes(): Unit
  
  /** Test PostgreSQL full-text search */
  def testFullTextSearch(): Unit
}

MySQL Integration Suite

MySQL-specific integration testing with character set handling and MySQL dialect features.

/**
 * MySQL-specific integration test suite
 * Tests MySQL-specific features, character sets, and SQL dialect
 */
class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite {
  override val databaseType = "mysql"
  override val databaseImage = "mysql:8.0"
  
  /** Test basic JDBC connectivity */
  def testBasicConnectivity(): Unit
  
  /** Test MySQL-specific SQL dialect compatibility */
  def testSqlDialectCompatibility(): Unit
  
  /** Test character set and collation handling */
  def testCharsetHandling(): Unit
  
  /** Test MySQL-specific data types */
  def testMySQLDataTypes(): Unit
  
  /** Test AUTO_INCREMENT columns */
  def testAutoIncrement(): Unit
  
  /** Test MySQL storage engines */
  def testStorageEngines(): Unit
}

MariaDB Integration Suite

MariaDB-specific testing for MariaDB features and MySQL compatibility.

/**
 * MariaDB-specific integration test suite
 * Tests MariaDB-specific features and MySQL compatibility
 */
class MariaDBIntegrationSuite extends DockerJDBCIntegrationSuite {
  override val databaseType = "mariadb"
  override val databaseImage = "mariadb:10.6"
  
  /** Test basic JDBC connectivity */
  def testBasicConnectivity(): Unit
  
  /** Test MariaDB-specific SQL features */
  def testMariaDBFeatures(): Unit
  
  /** Test MySQL compatibility mode */
  def testMySQLCompatibility(): Unit
  
  /** Test MariaDB JSON data type */
  def testJsonDataType(): Unit
  
  /** Test columnar storage engine */
  def testColumnStore(): Unit
}

Oracle Integration Suite

Oracle Database integration testing with advanced Oracle features and Kerberos authentication.

/**
 * Oracle-specific integration test suite
 * Tests Oracle-specific features, data types, and authentication
 */
class OracleIntegrationSuite extends DockerJDBCIntegrationSuite {
  override val databaseType = "oracle"
  override val databaseImage = "oracle/database:19.3.0-ee"
  
  /** Test basic JDBC connectivity */
  def testBasicConnectivity(): Unit
  
  /** Test Kerberos authentication support */
  def testKerberosAuthentication(): Unit
  
  /** Test Oracle-specific data types (CLOB, BLOB, etc.) */
  def testOracleSpecificTypes(): Unit
  
  /** Test Oracle sequences and triggers */
  def testSequencesAndTriggers(): Unit
  
  /** Test Oracle PL/SQL procedures */
  def testPLSQLProcedures(): Unit
  
  /** Test Oracle partitioning features */
  def testPartitioning(): Unit
  
  /** Test Oracle RAC connectivity */
  def testRACConnectivity(): Unit
}

DB2 Integration Suite

IBM DB2 integration testing with DB2-specific features and z/OS compatibility.

/**
 * IBM DB2-specific integration test suite
 * Tests DB2-specific features and SQL dialect
 */
class DB2IntegrationSuite extends DockerJDBCIntegrationSuite {
  override val databaseType = "db2"
  override val databaseImage = "ibmcom/db2:11.5.7.0a"
  
  /** Test basic JDBC connectivity */
  def testBasicConnectivity(): Unit
  
  /** Test DB2-specific SQL dialect */
  def testDB2SqlDialect(): Unit
  
  /** Test DB2-specific data types */
  def testDB2DataTypes(): Unit
  
  /** Test DB2 stored procedures */
  def testStoredProcedures(): Unit
  
  /** Test DB2 XML data type */
  def testXmlDataType(): Unit
  
  /** Test DB2 table spaces */
  def testTableSpaces(): Unit
}

SQL Server Integration Suite

Microsoft SQL Server integration testing with Windows authentication and SQL Server features.

/**
 * Microsoft SQL Server-specific integration test suite
 * Tests SQL Server-specific features and T-SQL dialect
 */
class SQLServerIntegrationSuite extends DockerJDBCIntegrationSuite {
  override val databaseType = "sqlserver"
  override val databaseImage = "mcr.microsoft.com/mssql/server:2019-latest"
  
  /** Test basic JDBC connectivity */
  def testBasicConnectivity(): Unit
  
  /** Test T-SQL dialect compatibility */
  def testTSqlDialect(): Unit
  
  /** Test SQL Server-specific data types */
  def testSqlServerDataTypes(): Unit
  
  /** Test Windows authentication */
  def testWindowsAuthentication(): Unit
  
  /** Test SQL Server indexes and constraints */
  def testIndexesAndConstraints(): Unit
  
  /** Test SQL Server temporal tables */
  def testTemporalTables(): Unit
}

Common Test Patterns

All database-specific test suites follow common patterns for consistent testing:

Basic Connectivity Tests

/**
 * Test basic JDBC connectivity
 * Verifies that Spark can connect to the database
 * Creates a simple DataFrame and validates data
 */
def testBasicConnectivity(): Unit

/**
 * Test connection pooling behavior
 * Verifies proper connection management
 */
def testConnectionPooling(): Unit

/**
 * Test connection timeout handling
 * Validates timeout configuration works correctly
 */
def testConnectionTimeout(): Unit

Data Type Testing

/**
 * Test database-specific data types
 * Ensures proper type mapping between Spark and database
 */
def testDataTypes(): Unit

/**
 * Test null value handling
 * Verifies NULL values are handled correctly
 */
def testNullHandling(): Unit

/**
 * Test large data handling
 * Tests CLOB, BLOB, and other large data types
 */
def testLargeDataTypes(): Unit

SQL Dialect Testing

/**
 * Test SQL dialect compatibility
 * Ensures database-specific SQL works correctly
 */
def testSqlDialectCompatibility(): Unit

/**
 * Test query pushdown optimization
 * Verifies queries are pushed down to database
 */
def testQueryPushdown(): Unit

/**
 * Test aggregate function pushdown
 * Tests pushdown of SUM, COUNT, etc.
 */
def testAggregatePushdown(): Unit

Database-Specific Features

PostgreSQL Features

  • Advanced data types (arrays, JSON, UUID)
  • Full-text search capabilities
  • PostGIS spatial extensions
  • Custom operator classes
  • Partial indexes

MySQL Features

  • Character set and collation handling
  • AUTO_INCREMENT columns
  • Storage engine selection (InnoDB, MyISAM)
  • MySQL-specific functions
  • Trigger and procedure support

Oracle Features

  • Advanced data types (CLOB, BLOB, XMLType)
  • Kerberos authentication
  • PL/SQL stored procedures
  • Oracle sequences and triggers
  • Partitioning and indexing
  • RAC (Real Application Clusters) support

DB2 Features

  • DB2-specific SQL dialect
  • XML data type support
  • Stored procedure integration
  • Table space management
  • z/OS connectivity (when applicable)

SQL Server Features

  • T-SQL dialect support
  • Windows authentication
  • Temporal tables
  • Advanced indexing features
  • SQL Server-specific data types
  • Integration Services (SSIS) compatibility

Usage Examples

// PostgreSQL testing
class MyPostgreSQLTest extends PostgreSQLIntegrationSuite {
  test("test JSON data type") {
    val jsonData = """{"name": "test", "value": 123}"""
    // Test PostgreSQL JSON operations
  }
}

// MySQL testing  
class MyMySQLTest extends MySQLIntegrationSuite {
  test("test character set handling") {
    // Test UTF-8 and other character sets
  }
}

// Oracle testing
class MyOracleTest extends OracleIntegrationSuite {
  test("test CLOB handling") {
    // Test large character data
  }
}