Re: [sqlite] Sqlite intarray issue

2018-11-02 Thread Roman Ivasyshyn
Thank you for the clarification.

On Wed, Oct 31, 2018 at 6:03 PM Richard Hipp  wrote:

> On 10/31/18, Roman Ivasyshyn  wrote:
> >
> > I faced with an issue of creating int array with the same name without
> > closing connection.
>
> That is not allowed.  But you can use sqlite3_intarray_bind() to
> change the array to which the intarray table is bound, or the length
> of the array.
>
> Another option is to use the carray() table-valued-function instead of
> the intarray virtual table.  The carray() function requires you to
> bind the array, the array length, and the array datatype at run-time.
> Multiple instances of the carray() table valued function, each with
> different array bindings, can participate in the same join.  You do
> not need to create multiple instances of carray(), one for each array.
> Indeed, that is not even allowed.  Instead in the single carray()
> table valued function can be reused for each array.
>
> More information on carray here: https://www.sqlite.org/carray.html
>
> The intarray virtual table predates the ability to have table valued
> functions in SQLite.  Intarray continues to be used for testing
> purposes but is no longer recommended for production use.  I have
> added a warning to this effect in the header comment.
> --
> D. Richard Hipp
> d...@sqlite.org
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite intarray issue

2018-10-31 Thread Richard Hipp
On 10/31/18, Roman Ivasyshyn  wrote:
>
> I faced with an issue of creating int array with the same name without
> closing connection.

That is not allowed.  But you can use sqlite3_intarray_bind() to
change the array to which the intarray table is bound, or the length
of the array.

Another option is to use the carray() table-valued-function instead of
the intarray virtual table.  The carray() function requires you to
bind the array, the array length, and the array datatype at run-time.
Multiple instances of the carray() table valued function, each with
different array bindings, can participate in the same join.  You do
not need to create multiple instances of carray(), one for each array.
Indeed, that is not even allowed.  Instead in the single carray()
table valued function can be reused for each array.

More information on carray here: https://www.sqlite.org/carray.html

The intarray virtual table predates the ability to have table valued
functions in SQLite.  Intarray continues to be used for testing
purposes but is no longer recommended for production use.  I have
added a warning to this effect in the header comment.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite intarray issue

2018-10-31 Thread Roman Ivasyshyn
Hello sqlite team,



I faced with an issue of creating int array with the same name without
closing connection.

I use sqlite3_intarray_create to create int array on a second call I
receive SQLITE_MISUSE error.

What I found inside create function that it tries to create module that
already exist with sqlite3_create_module_v2 function and drop table, before
second call, makes no effect on that module.



Please advice if it’s expected behavior and it there any workarounds on
that?



Regards,

Roman Ivasyshyn
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users