• Returns the read-only data source if it exists, otherwise returns the read-write data source if options is not provided or if options.allowFallbackToReadWrite is true.

    Parameters

    • dataSources: DataSourceInfo[]
    • Optional options: {
          allowFallbackToReadWrite: boolean;
      }
      • allowFallbackToReadWrite: boolean

    Returns sql.ConnectionPool & {
        query: ((sql, params?) => Promise<any[]>);
    }