Class: Ksql::Api::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/ksql/api/query.rb

Direct Known Subclasses

Stream

Constant Summary collapse

Headers =
{ 'Accept' => 'application/json' }.freeze

Class Method Summary collapse

Class Method Details

.build(sql, headers:, properties:, session_variables:) ⇒ Ksql::Connection::Request

Build the ksqlDB /query-stream request

Parameters:

  • sql (String)

    SQL Statement

  • headers (Hash)

    Request headers

  • properties (Hash)

    Optional properties for the query

  • session_variables (Hash)

    Variable substitution values

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ksql/api/query.rb', line 18

def self.build(sql, headers:, properties:, session_variables:)
  ::Ksql::Connection::Request.new(
    {
      sql: sql,
      properties: properties,
      sessionVariables: session_variables
    }.compact,
    '/query-stream',
    self::Headers.merge(headers),
    :post
  )
end