Class Quidem


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

      • 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 Detail

      • 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 Detail

      • 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