Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 11:51 PM, Dominique Devienne wrote: > > basically register_function('rpad', 'x', 'y', 'printf(''%-*s'', y, > x)') would register a 2-arg function (register_function's argc-2) > named $argv[0], which executes the following statement > > with

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Sat, Mar 8, 2014 at 2:16 AM, Clemens Ladisch wrote: > Eduardo Morras wrote: >> So, if a webapp that uses SQLite doesn't check it's input, functions that >> renames SQLite internals can be injected >> >> SELECT register_simple_function('MAX', 1, 'DROP TABLE ?'); > > Such a

Re: [sqlite] about "windows" downloadable versions

2014-03-07 Thread jose isaias cabrera
big stone" wrote... Hello, Wouldn't it be a good idea, for the "windows" download version, to propose also (or only) the "-o2 compiled" .dll and .exe versions ? (trading 300Ko of executable size for a 50% speed-up is a bargain, when you have a pc) I agree with this idea. If the

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Clemens Ladisch
Dominique Devienne wrote: >> On Fri, Mar 7, 2014 at 6:39 PM, Clemens Ladisch wrote: >>> SELECT register_simple_function('rpad', 2, 'SELECT printf(''%-*s'', ?, ?)'); > > But doesn't the above assume you can bind values inside the select > clause? I thought one couldn't...

Re: [sqlite] Suggestion to add "locate" as a broader version of "instr"

2014-03-07 Thread big stone
Ooups ! Thanks to the awesome posts about "RPAD/LPAD", I understood that I could already create a "sqrt()" function for SQLite3 in interpreted python. (example) *** import sqlite3 db_filename = ':memory:' def mysqrt(s): """ returns sqrt(s)""" #must return a string, apparently

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Clemens Ladisch
Eduardo Morras wrote: > Clemens Ladisch wrote: >> Actually, no change to SQLite itself would be needed. It's possible >> to create an extension that provides a function that allows to >> register another function that executes a custom SQL expression: >> >> SELECT

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Dominique Devienne
On Fri, Mar 7, 2014 at 10:19 PM, Eduardo Morras wrote: > On Fri, 07 Mar 2014 15:39:57 +0100 > Clemens Ladisch wrote: > >> Actually, no change to SQLite itself would be needed. It's possible >> to create an extension that provides a function that allows to

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Eduardo Morras
On Fri, 07 Mar 2014 15:39:57 +0100 Clemens Ladisch wrote: > Actually, no change to SQLite itself would be needed. It's possible > to create an extension that provides a function that allows to > register another function that executes a custom SQL expression: > > SELECT

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Dominique Devienne
On Fri, Mar 7, 2014 at 7:37 PM, Max Vlasov wrote: > On Fri, Mar 7, 2014 at 6:39 PM, Clemens Ladisch wrote: >> Max Vlasov wrote: >>> >>> Nice suggestion. This probably falls into case when a small new part >>> needed on sqlite side >> >> Actually, no

Re: [sqlite] extension search [was ... release schedule]

2014-03-07 Thread Larry Brasfield
*Jan Nijtmans wrote:* > But not in dlopen(): > See: > > Quoting: > If filename contains a slash ("/"), then it > is interpreted as a (relative or absolute) pathname. Otherwise, the > dynamic linker searches for the library as

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 6:39 PM, Clemens Ladisch wrote: > Max Vlasov wrote: >> >> Nice suggestion. This probably falls into case when a small new part >> needed on sqlite side > > Actually, no change to SQLite itself would be needed. It's possible > to create an extension that

[sqlite] How synchronize two databases

2014-03-07 Thread Muhammad Bashir Al-Noimi
Howdy, I've two identical sqlite databases from structure side. I want to make a synchronization for the data but I need to keep some tables away from the synchronization process. Is there any library can do that OR I've to do it by myself? P.S. * I'm using C++/Wt * I read about

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Dominique Devienne
On Fri, Mar 7, 2014 at 5:27 PM, Eleytherios Stamatogiannakis wrote: > IMHO, SQLite is targeted towards being a relational "core" with very wide > extensibility. Adding specific scripting engines to it is would be > detrimental to its main purpose (being a very good relational

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Eleytherios Stamatogiannakis
IMHO, SQLite is targeted towards being a relational "core" with very wide extensibility. Adding specific scripting engines to it is would be detrimental to its main purpose (being a very good relational "core"). In our group, we use SQLite + UDFs written in Python. Creating new functions is

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Dominique Devienne
On Fri, Mar 7, 2014 at 3:39 PM, Clemens Ladisch wrote: > Max Vlasov wrote: >> On Fri, Mar 7, 2014 at 12:49 PM, Dominique Devienne >> wrote: >>> I think what SQLite lacks is a syntax to define custom function like >>> it does for virtual tables. Something

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Clemens Ladisch
Max Vlasov wrote: > On Fri, Mar 7, 2014 at 12:49 PM, Dominique Devienne > wrote: >> I think what SQLite lacks is a syntax to define custom function like >> it does for virtual tables. Something like: >> >> create function rpad(x, y) using scripty_module as "return >>

[sqlite] Error with UTF8 and vbnet

2014-03-07 Thread Garikoitz Martínez Moreno
Hi, I'm using SQLite with Vb.net, concretly: - Visual Basic Net 2008 - Dll "sqlite-netFx35-binary-bundle-Win32-2008-1.0.91.0" I'm create a database with "sqliteadmin" and the database is UTF8 encoding, but when i reading data and charge in a listview or combobox the especial characters like "ñ"

Re: [sqlite] About "speed"

2014-03-07 Thread big stone
Hello, I Re-checked today the Mysql suspect performance, after a reboot, on : "select cand_nm, contbr_st, sum(contb_receipt_amt) as total from fec group by cand_nm, contbr_st;" This particular operation is now 7.1 seconds. I may have miss-used "MysqlWorkbench". ==> I updated the figure to the

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Dominique Devienne
On Fri, Mar 7, 2014 at 11:29 AM, Max Vlasov wrote: > On Fri, Mar 7, 2014 at 12:49 PM, Dominique Devienne > wrote: >> I think what SQLite lacks is a syntax to define custom function like >> it does for virtual tables. Something like: >> >> create

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 12:49 PM, Dominique Devienne wrote: > I think what SQLite lacks is a syntax to define custom function like > it does for virtual tables. Something like: > > create function rpad(x, y) using scripty_module as "return > PRINTF('%-*s',y,x)"; > Nice

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Dominique Devienne
On Fri, Mar 7, 2014 at 10:07 AM, Eduardo Morras wrote: > Creating extensions in SQLite is not difficult nor hard. You can define yours > with this line: It's no hard, no, if you're already a C developer. But it's hardly convenient when you need something quickly. Between

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Eduardo Morras
On Thu, 6 Mar 2014 22:41:31 -0500 Gabor Grothendieck wrote: > On Thu, Mar 6, 2014 at 8:41 PM, RSmith wrote: > > > > On 2014/03/07 01:59, Gabor Grothendieck wrote: > >> > >> > >>> > > > A small enhancement request: > > > > It would be

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Dominique Devienne
On Fri, Mar 7, 2014 at 7:38 AM, Zsbán Ambrus wrote: > On 3/7/14, RSmith wrote: >> Add to this the fact that you can - through SQL's ability to add >> user-defined functions (an almost unique ability among SQL engines) > > Is that really so? I thought most