Re: [sqlite] Row count of a partial index ?

2018-05-05 Thread Richard Hipp
On 5/5/18, Deon Brewis wrote: > Is there a direct way to query how many rows are in a partial index? > > I know I can repeat the WHERE clause expression in the query, but this is > for a dynamically constructed index and knowing what the current "where" > clause is on the index

[sqlite] Row count of a partial index ?

2018-05-05 Thread Deon Brewis
Is there a direct way to query how many rows are in a partial index? e.g. select count(*) from table indexed by partial_index (this does not work - no query solution). I know I can repeat the WHERE clause expression in the query, but this is for a dynamically constructed index and knowing

Re: [sqlite] Always call a value-quoting routine

2018-05-05 Thread José María Mateos
On Sat, May 05, 2018 at 11:57:22PM +0100, Simon Slavin wrote: > This is a genuine company registered under the UK Companies Act: > > > > The name of company is > > ; DROP TABLE "COMPANIES";-- LTD Obligatory: https://xkcd.com/327/ Cheers,

Re: [sqlite] Always call a value-quoting routine

2018-05-05 Thread Scott Robison
Thanks for sharing that. It will undoubtedly be useful to me in a computer security class I'm taking this semester. On Sat, May 5, 2018, 4:57 PM Simon Slavin wrote: > This is a genuine company registered under the UK Companies Act: > >

[sqlite] Always call a value-quoting routine

2018-05-05 Thread Simon Slavin
This is a genuine company registered under the UK Companies Act: The name of company is ; DROP TABLE "COMPANIES";-- LTD (Note: For legal reasons a UK company name must end in 'LTD' or 'plc', depending on the type of company it is.) Simon.

Re: [sqlite] Map a field type to a best suited sqlite3_result_* call

2018-05-05 Thread J Decker
On Sat, May 5, 2018 at 4:08 AM, Max Vlasov wrote: > On Sat, May 5, 2018 at 1:19 PM, J Decker wrote: > > > https://www.sqlite.org/c3ref/column_blob.html > > > > The sqlite3_column_type() routine returns the datatype code > > > > > Column api is not

Re: [sqlite] Map a field type to a best suited sqlite3_result_* call

2018-05-05 Thread Max Vlasov
On Sat, May 5, 2018 at 1:19 PM, J Decker wrote: > https://www.sqlite.org/c3ref/column_blob.html > > The sqlite3_column_type() routine returns the datatype code > Column api is not suitable for me since it relies on the actual data provided, but I'm the one who calls

Re: [sqlite] Map a field type to a best suited sqlite3_result_* call

2018-05-05 Thread J Decker
https://www.sqlite.org/c3ref/column_blob.html The sqlite3_column_type() routine returns the datatype code for the initial data type of the result column. The returned value is one of SQLITE_INTEGER, SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB, or SQLITE_NULL. The return value of sqlite3_column_type()

[sqlite] Map a field type to a best suited sqlite3_result_* call

2018-05-05 Thread Max Vlasov
Hi, What is the best way to map a field type as it is provided in create table statement to sqlite3_result_* function call? More specifically, I have a virtual table implementation where a raw table data provided and the corresponding field definition part ([FieldA] TEXT, [FieldB] FLOAT).