| 27 | } from '../../types'; |
| 28 | |
| 29 | function connectionConfig(options: SQLServerSourceOptions): SQLConfig { |
| 30 | return { |
| 31 | server: options.host, |
| 32 | port: options.port ?? 1433, |
| 33 | database: options.database, |
| 34 | user: options.user, |
| 35 | password: options.password, |
| 36 | connectionTimeout: options.connectionTimeoutMs ?? 10000, |
| 37 | requestTimeout: options.requestTimeoutMs ?? 30000, |
| 38 | options: { |
| 39 | encrypt: options.encrypt ?? true, |
| 40 | trustServerCertificate: options.trustServerCertificate ?? false, |
| 41 | }, |
| 42 | }; |
| 43 | } |
| 44 | |
| 45 | /** Describe even zero-row results using TDS column metadata. */ |
| 46 | function queryColumns(columns: IColumnMetadata[string][]): QueryColumn[] { |