@@ -9,16 +9,16 @@ const builder = new queryBuilder();
9
9
class ksqldb {
10
10
/**
11
11
* Constructor
12
- * @param {object } config
13
- *
14
- * Config object can have these properties
15
- *
12
+ * @param {object } config
13
+ *
14
+ * Config object can have these properties
15
+ *
16
16
* ksqldbURL: Connection URL or address
17
- *
17
+ *
18
18
* API: Username or API key for basic authentication
19
- *
19
+ *
20
20
* secret: Password or secret for basic authentication
21
- *
21
+ *
22
22
* httpsAgent: httpsAgent for setting TLS properties
23
23
*/
24
24
constructor ( config ) {
@@ -249,7 +249,7 @@ class ksqldb {
249
249
}
250
250
251
251
/**
252
- *
252
+ *
253
253
* @param {string } streamName - the name of the stream to be created
254
254
* @param {string[] } selectColumns - the columns from the underlying stream to be included in the new materialized stream
255
255
* @param {string } sourceStream - the underlying stream from which the new materialized stream will be created
@@ -347,12 +347,12 @@ class ksqldb {
347
347
//---------------------Create tables as select-----------------
348
348
/**
349
349
* Execute a query to create a new materialized table view of an existing table or stream
350
- *
350
+ *
351
351
* <p>This method is used to create a materialized table view
352
- *
352
+ *
353
353
* <p>This method is sql injection protected with the use of queryBuilder.
354
- *
355
- * @param {string } tableName name of the table to be created
354
+ *
355
+ * @param {string } tableName name of the table to be created
356
356
* @param {string } source name of the source stream / table materialized view is based on
357
357
* @param {array } selectArray an array that contains the values (strings, aggregate functions) of the columns for the materialized view table
358
358
* @param {object } propertiesObj an object containing key value pairs for supported table properties e.g {topic: 'myTopic', value_format: 'json', partitions: '1'}. {} for default values
@@ -365,7 +365,7 @@ class ksqldb {
365
365
let selectColStr = selectArray . reduce ( ( result , current ) => result + ', ' + current ) ;
366
366
367
367
// expect user to input properties object of format {topic: ... , value_format: ..., partitions: ...}
368
- // check for properties object, look for properties, if any are missing assign it a default value, if there's no property
368
+ // check for properties object, look for properties, if any are missing assign it a default value, if there's no property
369
369
const defaultProps = {
370
370
topic : tableName ,
371
371
value_format : 'json' ,
@@ -397,7 +397,7 @@ class ksqldb {
397
397
i += 2 ;
398
398
conditionsArr . shift ( )
399
399
}
400
- conditionQuery = builder . build ( `${ sqlClauses [ 0 ] [ 0 ] } ${ sqlClauses [ 1 ] [ 0 ] } ????` , sqlClauses [ 2 ] , sqlClauses [ 3 ] , sqlClauses [ 4 ] , sqlClauses [ 5 ] ) ;
400
+ conditionQuery = builder . build ( `${ sqlClauses [ 0 ] [ 0 ] } ${ sqlClauses [ 1 ] [ 0 ] } ??${ sqlClauses [ 4 ] [ 0 ] } ${ sqlClauses [ 5 ] [ 0 ] } ` , sqlClauses [ 2 ] , sqlClauses [ 3 ] ) ;
401
401
}
402
402
403
403
// reformat for builder
0 commit comments