Alien-DBD-SQLite-BundledExtensions

 view release on metacpan or  search on metacpan

lib/DBD/SQLite/BundledExtensions.pm  view on Meta::CPAN

       the Y values are ordered from least to greatest and a graph is
       drawn from 0 to N-1 such that the height of the graph at J is
       the J-th Y value and such that straight lines are drawn between
       adjacent Y values, then the percentile(Y,P) function returns
       the height of the graph at P*(N-1)/100.
 (11)  The percentile(Y,P) function always returns either a floating
       point number or NULL.
 (12)  The percentile(Y,P) is implemented as a single C99 source-code
       file that compiles into a shared-library or DLL that can be loaded
       into SQLite using the sqlite3_load_extension() interface.

=item series 

This extension implements the generate_series() function
which gives similar results to the eponymous function in PostgreSQL.

Examples:

     SELECT * FROM generate_series(0,100,5);

The query above returns integers from 0 through 100 counting by steps
of 5.

     SELECT * FROM generate_series(0,100);

Integers from 0 through 100 with a step size of 1.

     SELECT * FROM generate_series(20) LIMIT 10;

Integers 20 through 29.

HOW IT WORKS

The generate_series "function" is really a virtual table with the
following schema:

    CREATE FUNCTION generate_series(
      value,
      start HIDDEN,
      stop HIDDEN,
      step HIDDEN
    );

Function arguments in queries against this virtual table are translated
into equality constraints against successive hidden columns.  In other
words, the following pairs of queries are equivalent to each other:

   SELECT * FROM generate_series(0,100,5);
   SELECT * FROM generate_series WHERE start=0 AND stop=100 AND step=5;
   SELECT * FROM generate_series(0,100);
   SELECT * FROM generate_series WHERE start=0 AND stop=100;
   SELECT * FROM generate_series(20) LIMIT 10;
   SELECT * FROM generate_series WHERE start=20 LIMIT 10;

The generate_series virtual table implementation leaves the xCreate method
set to NULL.  This means that it is not possible to do a CREATE VIRTUAL
TABLE command with "generate_series" as the USING argument.  Instead, there
is a single generate_series virtual table that is always available without
having to be created first.

The xBestIndex method looks for equality constraints against the hidden
start, stop, and step columns, and if present, it uses those constraints
to bound the sequence of generated values.  If the equality constraints
are missing, it uses 0 for start, 4294967295 for stop, and 1 for step.
xBestIndex returns a small cost when both start and stop are available,
and a very large cost if either start or stop are unavailable.  This
encourages the query planner to order joins such that the bounds of the
series are well-defined.

=item spellfix 

This module implements the spellfix1 VIRTUAL TABLE that can be used
to search a large vocabulary for close matches.  See separate
documentation (http://www.sqlite.org/spellfix1.html) for details.

=item totype 

This SQLite extension implements functions tointeger(X) and toreal(X).

If X is an integer, real, or string value that can be
losslessly represented as an integer, then tointeger(X)
returns the corresponding integer value.
If X is an 8-byte BLOB then that blob is interpreted as
a signed two-compliment little-endian encoding of an integer
and tointeger(X) returns the corresponding integer value.
Otherwise tointeger(X) return NULL.

If X is an integer, real, or string value that can be
convert into a real number, preserving at least 15 digits
of precision, then toreal(X) returns the corresponding real value.
If X is an 8-byte BLOB then that blob is interpreted as
a 64-bit IEEE754 big-endian floating point value
and toreal(X) returns the corresponding real value.
Otherwise toreal(X) return NULL.

Note that tointeger(X) of an 8-byte BLOB assumes a little-endian
encoding whereas toreal(X) of an 8-byte BLOB assumes a big-endian
encoding.

=item wholenumber

This file implements a virtual table that returns the whole numbers
between 1 and 4294967295, inclusive.

Example:

    CREATE VIRTUAL TABLE nums USING wholenumber;
    SELECT value FROM nums WHERE value<10;

Results in:

    1 2 3 4 5 6 7 8 9

=back

=head1 AUTHORS
 
Ryan Voots E<lt>simcop2387@simcop2387.infoE<gt>

=head1 COPYRIGHT
 



( run in 0.602 second using v1.01-cache-2.11-cpan-0068ddc7af1 )