Class Quidem

java.lang.Object
net.hydromatic.quidem.Quidem

public class Quidem extends Object
Runs a SQL script.
  • Field Details

    • DEBUG

      public static final boolean DEBUG
    • EMPTY_ENV

      public static final Function<String,Object> EMPTY_ENV
      The empty environment. Returns null for all variables.
    • EMPTY_CONNECTION_FACTORY

      public static final Quidem.ConnectionFactory EMPTY_CONNECTION_FACTORY
      The empty environment. Returns null for all database names.
    • EMPTY_COMMAND_HANDLER

      public static final CommandHandler EMPTY_COMMAND_HANDLER
      A command handler that defines no commands.
    • EMPTY_PROPERTY_HANDLER

      public static final Quidem.PropertyHandler EMPTY_PROPERTY_HANDLER
      A property handler that does nothing.
  • Constructor Details

    • Quidem

      public Quidem(Reader reader, Writer writer)
      Creates a Quidem interpreter with an empty environment and empty connection factory.
    • Quidem

      public Quidem(Quidem.Config config)
      Creates a Quidem interpreter.
  • Method Details

    • configBuilder

      public static Quidem.ConfigBuilder configBuilder()
      Creates a Quidem.ConfigBuilder with the default settings.
    • main

      public static void main(String[] args)
      Entry point from the operating system command line.

      Calls System.exit(int) with the following status codes:

      • 0: success
      • 1: invalid arguments
      • 2: help
      Parameters:
      args - Command-line arguments
    • execute

      public void execute()
      Executes the commands from the input, writing to the output, then closing both input and output.
    • isProbablyDeterministic

      public boolean isProbablyDeterministic(String sql)
      Returns whether a SQL query is likely to produce results always in the same order.

      If Quidem believes that the order is deterministic, it does not sort the rows before comparing them.

      The result is just a guess. Quidem does not understand the finer points of SQL semantics.

      Parameters:
      sql - SQL query
      Returns:
      Whether the order is likely to be deterministic