Skip to content

drivers / all drivers should use the same parameters for the connection string #68

@gionatamettifogo

Description

@gionatamettifogo

We should have one type of connection string and it should work across devices. Doesn't really matter what the names are too much, but they should be the same in Javascript, core library, python and what not. I propose the format below. Let's discuss below...

Plus feature: Humans aren't perfect, so let make all options work regarless of case if we can, eg.:
sqlitecloud://host.sqlite.cloud:8860apiKey=xxx
sqlitecloud://host.sqlite.cloud:8860apikey=xxx

/** Configuration for SQLite cloud connection */
export interface SQLiteCloudConfig {
  /** Connection string in the form of sqlitecloud://user:password@host:port/database?options */
  connectionString?: string

  /** User name is required unless connectionString is provided */
  username?: string
  /** Password is required unless connection string is provided */
  password?: string
  /** True if password is hashed, default is false */
  passwordHashed?: boolean
  /** API key can be provided instead of username and password */
  apiKey?: string

  /** Host name is required unless connectionString is provided, eg: xxx.sqlitecloud.io */
  host?: string
  /** Port number for tls socket */
  port?: number
  /** Connect using plain TCP port, without TLS encryption, NOT RECOMMENDED, TEST ONLY */
  insecure?: boolean

  /** Optional query timeout passed directly to TLS socket */
  timeout?: number
  /** Name of database to open */
  database?: string

  /** Create the database if it doesn't exist? */
  createDatabase?: boolean
  /** Database will be created in memory */
  dbMemory?: boolean
  /* Enable compression */
  compression?: boolean
  /** Request for immediate responses from the server node without waiting for linerizability guarantees */
  nonlinearizable?: boolean
  /** Server should send BLOB columns */
  noBlob?: boolean
  /** Do not send columns with more than max_data bytes */
  maxData?: number
  /** Server should chunk responses with more than maxRows */
  maxRows?: number
  /** Server should limit total number of rows in a set to maxRowset */
  maxRowset?: number

  /** Custom options and configurations for tls socket, eg: additional certificates */
  tlsOptions?: tls.ConnectionOptions

  /** True if we should force use of SQLite Cloud Gateway and websocket connections, default: true in browsers, false in node.js */
  useWebsocket?: boolean
  /** Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. wss://host:4000 */
  gatewayUrl?: string

  /** Optional identifier used for verbose logging */
  clientId?: string
  /** True if connection should enable debug logs */
  verbose?: boolean
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions