Create an in-memory database structure from an Oracle instance

后端 未结 4 781
一生所求
一生所求 2021-01-30 10:56

I have an application where many \"unit\" tests use a real connection to an Oracle database during their execution.

As you can imagine, these tests take too muc

4条回答
  •  忘掉有多难
    2021-01-30 11:49

    Latest HSQLDB 2.0.1 supports ORACLE syntax for DUAL, ROWNUM, NEXTVAL and CURRVAL via a syntax compatibility flag, sql.syntax_ora=true. In the same manner, concatenation of a string with a NULL string and restrictions on NULL in UNIQUE constraints are handled with other flags. Most ORACLE functions such as TO_CHAR, TO_DATE, NVL etc. are already built in.

    At the moment, to use simple ORACLE types such as NUMBER, you can use a type definition:

    CREATE TYPE NUMBER AS NUMERIC

    The next snapshot will allow NUMBER(N) and other aspects of ORACLE type compatibility when the flag is set.

    Download from http://hsqldb.org/support/

    [Update:] The snapshot issued on Oct 4 translates most Oracle specific types to ANSI SQL types. HSQLDB 2.0 also supports the ANSI SQL INTERVAL type and date / timestamp arithmetic the same way as Oracle.

提交回复
热议问题