[ANN] Pharo-SQLite even more multilingual
Hi all, I've enhanced the Pharo SQLite library to be even more multilingual. It has always supported data elements that are Pharo WideString instances, these being converted to/from UTF8 transparently by the library. Now the library also handles multilingual table names, column names and default column values; in other words, multilingual SQL statements. To install in Pharo 7, load GlorpSQLite from the Catalog Browser. Example: | db | db := UDBCSQLite3Connection openOn: '/tmp/ml.db'. [ "Chinese table name, column names, and default column value." db basicExecute: 'create table è¡¨ä¸ (é®ä¸ integer primary key, åäº text default ''䏿'');'. "Insert a row, taking default column value for the 2nd column." db basicExecute: 'insert into è¡¨ä¸ (é®ä¸) values (NULL)'. "Insert another row, specifying a value in Chinese for the 2nd column." db execute: 'insert into è¡¨ä¸ values (NULL, ?)' with: (Array with: 'å¼äº'). (db execute: 'select * from 表ä¸') rows inspect. ] ensure: [ db close ]
From the SQLite shell:
% sqlite3 /tmp/ml.db SQLite version 3.27.2 2019-02-25 16:06:06 Enter ".help" for usage hints. sqlite> .header on sqlite> .schema CREATE TABLE è¡¨ä¸ (é®ä¸ integer primary key, åäº text default '䏿'); sqlite> select * from 表ä¸; é®ä¸|åäº 1|䏿 2|å¼äº sqlite> Testing and feedback welcome, especially on which other parts of the library needing internationalization. Pierce
Wow! I wasn't aware SQLite supported that. Thank you from bringing such powerful, yet small, database to Pharo. Esteban A. Maringolo El sáb., 2 mar. 2019 a las 10:17, Pierce Ng (<pierce@samadhiweb.com>) escribió:
Hi all,
I've enhanced the Pharo SQLite library to be even more multilingual. It has always supported data elements that are Pharo WideString instances, these being converted to/from UTF8 transparently by the library. Now the library also handles multilingual table names, column names and default column values; in other words, multilingual SQL statements.
To install in Pharo 7, load GlorpSQLite from the Catalog Browser.
Example:
| db | db := UDBCSQLite3Connection openOn: '/tmp/ml.db'. [ "Chinese table name, column names, and default column value." db basicExecute: 'create table è¡¨ä¸ (é®ä¸ integer primary key, åäº text default ''䏿'');'. "Insert a row, taking default column value for the 2nd column." db basicExecute: 'insert into è¡¨ä¸ (é®ä¸) values (NULL)'. "Insert another row, specifying a value in Chinese for the 2nd column." db execute: 'insert into è¡¨ä¸ values (NULL, ?)' with: (Array with: 'å¼äº'). (db execute: 'select * from 表ä¸') rows inspect. ] ensure: [ db close ]
From the SQLite shell:
% sqlite3 /tmp/ml.db SQLite version 3.27.2 2019-02-25 16:06:06 Enter ".help" for usage hints. sqlite> .header on sqlite> .schema CREATE TABLE è¡¨ä¸ (é®ä¸ integer primary key, åäº text default '䏿'); sqlite> select * from 表ä¸; é®ä¸|åäº 1|䏿 2|å¼äº sqlite>
Testing and feedback welcome, especially on which other parts of the library needing internationalization.
Pierce
Thanks! Hilaire Le 02/03/2019 à 14:16, Pierce Ng a écrit :
I've enhanced the Pharo SQLite library to be even more multilingual. It has
-- Dr. Geo http://drgeo.eu
participants (3)
-
Esteban Maringolo -
Hilaire -
Pierce Ng