WASP

classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

WASP

Theodore M. Rolle, Jr. (Ted)
First there was LAMP (Linux, Apache, MySQL, PHP), then WAMP (Windows,
Apache MySQL, PHP).
Now we need a WASP.

I don't relish the thought of converting my SQLite database to
MySQL just to keep some package happy.

If my Linux box were up, it would be a no-brainer.  I'd compile it for
SQLite.  But as is well known, Windows users don't have that option.

Ted
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

Igor Tandetnik
Ted Rolle wrote:
> First there was LAMP (Linux, Apache, MySQL, PHP), then WAMP (Windows,
> Apache MySQL, PHP).
> Now we need a WASP.
>
> I don't relish the thought of converting my SQLite database to
> MySQL just to keep some package happy.
>
> If my Linux box were up, it would be a no-brainer.  I'd compile it for
> SQLite.  But as is well known, Windows users don't have that option.

I don't at all understand what you are talking about. It's not like Windows comes preinstalled with Apache, MySQL or PHP any more than it does SQLite. What is this "package" that you need to keep "happy"?

Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

Theodore M. Rolle, Jr. (Ted)
On Sat, 7 Nov 2009 20:39:22 -0500
"Igor Tandetnik" <[hidden email]> wrote:

> Ted Rolle wrote:
> > First there was LAMP (Linux, Apache, MySQL, PHP), then WAMP
> > (Windows, Apache MySQL, PHP).
> > Now we need a WASP.
> >
> > I don't relish the thought of converting my SQLite database to
> > MySQL just to keep some package happy.
> >
> > If my Linux box were up, it would be a no-brainer.  I'd compile it
> > for SQLite.  But as is well known, Windows users don't have that
> > option.
>
> I don't at all understand what you are talking about. It's not like
> Windows comes preinstalled with Apache, MySQL or PHP any more than it
> does SQLite. What is this "package" that you need to keep "happy"?
>
> Igor Tandetnik
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

WAMP ia an installable package for Windows that gives the Windows user
Apache, MySQL, and PHP.  I'd like to see SQLite instead of MySQL as the
database.

Ted
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

J. King-3
On Sat, 07 Nov 2009 21:04:59 -0500, Ted Rolle <[hidden email]> wrote:

> WAMP ia an installable package for Windows that gives the Windows user
> Apache, MySQL, and PHP.  I'd like to see SQLite instead of MySQL as the
> database.

You should have this already: SQLite is embedded within PHP since 5.0.0.  
The SQLite library is typically not up to date, unfortunately, but it is  
nevertheless there.  The PDO interface lacks most of SQLite's more  
advanced features, but the SQLite3 extension (included by default since  
PHP 5.3) is, I believe, feature-complete.

--
J. King
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

Puneet Kishor-2
In reply to this post by Theodore M. Rolle, Jr. (Ted)
On Sat, Nov 7, 2009 at 8:04 PM, Ted Rolle <[hidden email]> wrote:

> On Sat, 7 Nov 2009 20:39:22 -0500
> "Igor Tandetnik" <[hidden email]> wrote:
>
>> Ted Rolle wrote:
>> > First there was LAMP (Linux, Apache, MySQL, PHP), then WAMP
>> > (Windows, Apache MySQL, PHP).
>> > Now we need a WASP.
>> >
>> > I don't relish the thought of converting my SQLite database to
>> > MySQL just to keep some package happy.
>> >
>> > If my Linux box were up, it would be a no-brainer.  I'd compile it
>> > for SQLite.  But as is well known, Windows users don't have that
>> > option.
>>

Download and install Apache --> one click
Download and install ActiveState Perl --> one click
Download and install DBD::SQLite --> one click

There is no 4th step.


>> I don't at all understand what you are talking about. It's not like
>> Windows comes preinstalled with Apache, MySQL or PHP any more than it
>> does SQLite. What is this "package" that you need to keep "happy"?
>>
>> Igor Tandetnik
>>
>> _______________________________________________
>> sqlite-users mailing list
>> [hidden email]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> WAMP ia an installable package for Windows that gives the Windows user
> Apache, MySQL, and PHP.  I'd like to see SQLite instead of MySQL as the
> database.
>
> Ted
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
Sent from Madison, WI, United States
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

Theodore M. Rolle, Jr. (Ted)
On Sun, 8 Nov 2009 14:48:08 -0600
P Kishor <[hidden email]> wrote:

> DBD::SQLite
Hmmm...no 4th step. That's one of the most important steps.  But then
I'm used to 12 steps... :-)

I don't know Perl.  Is Perl 'under the covers' when I use PHP?

Ted
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

Puneet Kishor-2
On Sun, Nov 8, 2009 at 3:34 PM, Ted Rolle <[hidden email]> wrote:
> On Sun, 8 Nov 2009 14:48:08 -0600
> P Kishor <[hidden email]> wrote:
>
>> DBD::SQLite
> Hmmm...no 4th step. That's one of the most important steps.  But then
> I'm used to 12 steps... :-)
>
> I don't know Perl.  Is Perl 'under the covers' when I use PHP?
>

You mentioned WASP, and Perl starts with P. If you know PHP, stick to
what you know. The most powerful language is the one you know best.


> Ted
>



--
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
Sent from Madison, WI, United States
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

Oftenwrong Soong
In reply to this post by J. King-3
On Sat, 07 Nov 2009 21:04:59 -0500, Ted Rolle <[hidden email]> wrote:
<snip>
>> I'd like to see SQLite instead of MySQL as the
>> database.
>
> You should have this already: SQLite is embedded within PHP since 5.0.0.  
> The SQLite library is typically not up to date, unfortunately, but it is  
> nevertheless there.
<snip>

I'm not familiar with PHP but since SQLite is distributed as a single C file (the amalgamation) wouldn't it be trivial to substitute the newest version into PHP?

Soong



     
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: WASP

Kees Nuyt
On Sun, 8 Nov 2009 18:48:40 -0800 (PST), Oftenwrong Soong
<[hidden email]> wrote:

>On Sat, 07 Nov 2009 21:04:59 -0500, Ted Rolle <[hidden email]> wrote:
><snip>
>>> I'd like to see SQLite instead of MySQL as the
>>> database.
>>
>> You should have this already: SQLite is embedded within PHP since 5.0.0.  
>> The SQLite library is typically not up to date, unfortunately, but it is  
>> nevertheless there.
><snip>
>
> I'm not familiar with PHP but since SQLite is distributed
> as a single C file (the amalgamation) wouldn't it be trivial
> to substitute the newest version into PHP?

Not really, the 'native' php_sqlite is a php specific
wrapper which implements the php sqlite_* interface and
includes the sqlite library source.

pdo_sqlite follows the same scheme, but has a different
(object oriented) interface. The sqlite version it uses
cannot easily be replaced.

Both constructs are maintained by the packager.

The only one which is easily maintainable by the
administrator of the system it has to run on is
pdo_sqlite_external, where the pdo wrapper is a separate
library, next to the sqlite library. In this case one can
use the most recent version simply by replacing the sqlite3
library.

>Soong
--
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

another Feature Request: char from codepoint?

Tim Romano
In reply to this post by Puneet Kishor-2
I wanted to get a clearer sense of how SQLite treats decomposed Unicode
characters (http://unicode.org/faq/char_combmark.html#2) in its various
string functions and with the concatenation operator yet there doesn't
seem to be any way to get them into the database using the SQlite3.EXE
command-line.   I didn't see a  function like SQLServer's NCHAR() that
returns a character (~Unicode string) from a codepoint, which would
enable something along these lines from the command-line:

insert test
(id, myTextColumn)
values(1, unicharFromCodePoint(437) || unicharFromCodePoint(807) ) --
Latin capital letter Z with stroke (U+01B5)  || a combining cedilla (U+0327)

This would be a convenient function to have. Are there technical
issues/obstacles?

Thanks



_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Igor Tandetnik
Tim Romano <[hidden email]> wrote:
> I wanted to get a clearer sense of how SQLite treats decomposed
> Unicode characters (http://unicode.org/faq/char_combmark.html#2) in
> its various string functions and with the concatenation operator yet
> there doesn't
> seem to be any way to get them into the database using the SQlite3.EXE
> command-line.

select cast(x'41' as text);
A

The blob (x'41' is a blob literal) is expected to contain a UTF-8 sequence, I believe.

Igor Tandetnik


_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Jean-Christophe Deschamps
Hi Igor,


>The blob (x'41' is a blob literal) is expected to contain a UTF-8
>sequence, I believe.

That means the user enters the hex UTF-8 (or 16 depending on base
encoding) representation of the character. E.g.:

select cast(x'c389' as text);
É

Something like:
        select chrw(x'c9');
   or
        select chrw(201);
would be much more convenient and not depend on base encoding IMHO.



_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Pavel Ivanov-2
In reply to this post by Igor Tandetnik
> The blob (x'41' is a blob literal) is expected to contain a UTF-8 sequence, I believe.

I think it should be a database encoding which is either UTF-8 or
UTF-16. So for Tim's case if his database encoding is UTF-16 insert
statement can be like this:

insert test (id, myTextColumn) values(1, x'01B50327')

I'm not sure about byte order here but it can be easily determined
with some tests.

Pavel

On Wed, Nov 18, 2009 at 11:13 AM, Igor Tandetnik <[hidden email]> wrote:

> Tim Romano <[hidden email]> wrote:
>> I wanted to get a clearer sense of how SQLite treats decomposed
>> Unicode characters (http://unicode.org/faq/char_combmark.html#2) in
>> its various string functions and with the concatenation operator yet
>> there doesn't
>> seem to be any way to get them into the database using the SQlite3.EXE
>> command-line.
>
> select cast(x'41' as text);
> A
>
> The blob (x'41' is a blob literal) is expected to contain a UTF-8 sequence, I believe.
>
> Igor Tandetnik
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Roger Binns
In reply to this post by Tim Romano
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Romano wrote:
> This would be a convenient function to have. Are there technical
> issues/obstacles?

In general for all these feature requests for more functions there is no
need for them to be added to the SQLite core.  There is a very simple API
and extension mechanism whereby you can add your own functions that do
exactly what you want.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksEN2kACgkQmOOfHg372QTmXgCglwgqyLB6ouPgOmj0M8s3wD3M
cEYAoKD2bWVUnvR4e7DnaBFC6kVbOM+c
=t3xA
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Simon Slavin-3

On 18 Nov 2009, at 6:05pm, Roger Binns wrote:

> Tim Romano wrote:
>> This would be a convenient function to have. Are there technical
>> issues/obstacles?
>
> In general for all these feature requests for more functions there is no
> need for them to be added to the SQLite core.  There is a very simple API
> and extension mechanism whereby you can add your own functions that do
> exactly what you want.

I googled, and there doesn't seem to be a page which describes the abilities and limitations the extension system has.  I'd like to check, then, with someone who understands how to write extensions.

(A) Is it possible to define a new datatypen ?  If the data itself was really stored in a BLOB, that would be okay, but I wouldn't want my users to know that, I'd want them to use this new datatype when they created columns.

(B) If not, then if I needed to store some additional information for every TEXT field, could I do that ?  If it was necessary to store it in a different table in the same database, e.g. to define a new table with

tablename fieldname rowid columnname language

that would be acceptable though very slow, but can an extension do that sort of thing ?  And can a routine of an extension be automatically called whenever any row, column or table in the database is created/deleted ?

(C) Is it possible to put a note inside a database file so that if a database was opened without a particular extension being loaded, an error would occur ?  For example a SQLITE error code, with error text something like "This database cannot be used without version 1.1 or higher of the extension 'complex numbers' being loaded." ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Roger Binns
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Simon Slavin wrote:
> I googled, and there doesn't seem to be a page which describes the abilities and limitations the extension system has.

A C function of your choosing can be called on each new connection being
created:

  http://sqlite.org/c3ref/auto_extension.html

You can create collations, functions, virtual tables and VFS:

 http://sqlite.org/c3ref/collation_needed.html
 http://sqlite.org/c3ref/create_collation.html
 http://sqlite.org/c3ref/create_function.html
 http://sqlite.org/c3ref/create_module_v2.html
 http://sqlite.org/c3ref/vfs_find.html

[Details given to help future searches]

> (A) Is it possible to define a new datatypen ?

At the SQLite level no.  This is because a new datatype would require a
change to the file format and would require adding APIs for that type (eg to
bind values, receive values etc).  If you wanted it visible in SQL then
you'd also need new syntax which means updating the tokenizer and grammar.

(Note: SQLite code is public domain so you are free to make an incompatible
version with desired capabilities - it is just a lot of work.)

> If the data itself was really stored in a BLOB, that would be okay, but I
wouldn't want my users to know that, I'd want them to use this new datatype
when they created columns.

You can do this by wrapping your access to the SQLite C API.  For example
some language bindings do it (but there are gotchas).  I'll use an example
of a Point object (with x and y members).

You would need to provide an equivalent to the bind API:

  http://sqlite.org/c3ref/bind_blob.html

For example you could make bind_point which then created the blob from the
point data supplied and called sqlite3_bind_blob.  You could even make this
possible at the SQL level by a user defined function that returns a blob so
this would work:

  INSERT INTO foo VALUES( Point(3,4) );

When values are returned you'd need some way of trying to extract a Point
instead of a blob.  In some cases you can use the declared type of a column:

  http://sqlite.org/c3ref/column_decltype.html

However that only works when there are no calculations on a column.  IIRC
you also get NULL when going via a view.

Note that existing SQLite functions are not going to know anything about
your "type".  For example you'll be able to quite happily get the length of
a Point and + or || operators certainly won't do what the user would expect.

> (B) If not, then if I needed to store some additional information for every TEXT field, could I do that ?  If it was necessary to store it in a different table in the same database,

That is trivial to do using virtual tables.

> but can an extension do that sort of thing

Yes, extensions can implement virtual tables.

>  And can a routine of an extension be automatically called whenever any row, column or table in the database is created/deleted ?

Mostly, see the virtual table method list:  http://sqlite.org/c3ref/module.html

Note: you only get called with tables specifically created using your
virtual table module.

> (C) Is it possible to put a note inside a database file so that if a database was opened without a particular extension being loaded, an error would occur ?

No.  That would require a file format change.  However if the file has a
virtual table and the module for that virtual table is not loaded then there
will be an appropriate error message generated on first access to that
virtual table.

If you want to experiment with virtual tables and know Python then APSW is a
good place to start (disclosure I am the author of APSW).

  http://apsw.googlecode.com/svn/publish/vtable.html
  http://apsw.googlecode.com/svn/publish/example.html#example-vtable

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksEZsIACgkQmOOfHg372QSUoQCgyPr14la+YXkx67hxIBG9njhI
otoAoIsR3ASbbuMoYxqbEwnaeBhOQr2O
=N5UO
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Tim Romano
In reply to this post by Roger Binns
I respectfully disagree, Roger, about the simplicity.  Creating an
external DLL would complicate my distribution scenario significantly
because I'll  have just as many users of my little database application
working with Apple OSX as with Windows.  I guarantee you, it would be
easier for the very skilled programmers at SQLite to set these functions
up to be included|excluded by throwing a few compiler switches (as they
do for soundex() )  than for me to make my own external library for both
OSX and Windows platforms. Basing that strictly on my own set of limited
competencies.

BTW, the Microsoft SQL Server 2000 reverse() function does it codepoint
by codepoint, and their substring() function also splits combining
characters from base characters; the len() function counts codepoints
too, and does not merge combining forms and base forms into one unit.

Regards
Tim Romano

Roger Binns wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Tim Romano wrote:
>  
>> This would be a convenient function to have. Are there technical
>> issues/obstacles?
>>    
>
> In general for all these feature requests for more functions there is no
> need for them to be added to the SQLite core.  There is a very simple API
> and extension mechanism whereby you can add your own functions that do
> exactly what you want.
>
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAksEN2kACgkQmOOfHg372QTmXgCglwgqyLB6ouPgOmj0M8s3wD3M
> cEYAoKD2bWVUnvR4e7DnaBFC6kVbOM+c
> =t3xA
> -----END PGP SIGNATURE-----
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.425 / Virus Database: 270.14.72/2511 - Release Date: 11/18/09 07:50:00
>
>  

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Tim Romano
In reply to this post by Tim Romano
Apologies. An accident -- I was trying to grab the To: address from a
previous email and didn't realize there was a big thing attached.  I
don't see anything attached to this one. I hope there isn't.
Tim Romano


Jean-Christophe Deschamps wrote:
>
> Please don't set the ReplyTo field to the list when sending personal
> mail.  There is no big secret here, but the list didn't appreciate
> this big thing and it desn't insert in a thread.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Igor Tandetnik
In reply to this post by Tim Romano
Tim Romano <[hidden email]> wrote:
> I respectfully disagree, Roger, about the simplicity.  Creating an
> external DLL would complicate my distribution scenario significantly
> because I'll  have just as many users of my little database
> application working with Apple OSX as with Windows.

You don't need external DLL. You can implement your custom function directly in your application.

Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: another Feature Request: char from codepoint?

Simon Slavin-3
In reply to this post by Roger Binns

On 18 Nov 2009, at 9:27pm, Roger Binns wrote:

> A C function of your choosing can be called on each new connection being
> created:[snip]

Thanks for your detailed answer.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
12