Re: [sqlite] Re: creating own pragmas
Christian Smith schrieb: Dennis Cote uttered: Igor Tandetnik schrieb: G�nter Greschenz <[EMAIL PROTECTED]> wrote: i'm using "sqlite3_create_function()" to create own functions in my database. this is a really nice possibility to extend the database with powerful functions. but i did not find a way to create own pragmas like "pragma foo=bar" to pass some global information to my application. Pass global information from where? Why would your application use such a roundabout way to pass global information to itself? If you need to store some global settings in the database, why not just create a table for them? Gunter, Igor is right, you should store your password in a table. If you are concerned about the password being saved in the database, then you could use a temporary table, or even attach a :memory: database to hold the table that contains the password. In any case the saved password is available to your encrypt and decrypt functions. Or, even define a custom function to set the password: SELECT set_password('password'); yes, sounds like a portable solution. until now i patched the pragma-code (was just 3 lines), because i think its much more elegant to use, but to avoid sqlite-source-ipdate-problems, i'll implement this too. thanks ! HTH Dennis Cote Christian -- /"\ \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \ - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Re: creating own pragmas
Dennis Cote uttered: Igor Tandetnik schrieb: G�nter Greschenz <[EMAIL PROTECTED]> wrote: i'm using "sqlite3_create_function()" to create own functions in my database. this is a really nice possibility to extend the database with powerful functions. but i did not find a way to create own pragmas like "pragma foo=bar" to pass some global information to my application. Pass global information from where? Why would your application use such a roundabout way to pass global information to itself? If you need to store some global settings in the database, why not just create a table for them? Gunter, Igor is right, you should store your password in a table. If you are concerned about the password being saved in the database, then you could use a temporary table, or even attach a :memory: database to hold the table that contains the password. In any case the saved password is available to your encrypt and decrypt functions. Or, even define a custom function to set the password: SELECT set_password('password'); HTH Dennis Cote Christian -- /"\ \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \ - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Re: creating own pragmas
Günter Greschenz wrote: hi, i implemented crypting for values: insert into test (x, y, z) values(encrypt('this is a test', 'pwd'), 'foo', 'bar') insert into test (x, y, z) values(encrypt('this is test 2', 'pwd'), 'foo2', 'bar2') ... select decrypt(x, 'pwd') x, y, z from test where decrypt(x, 'pwd') like 'this%' but setting the password each time is quiet time-expensive. so i want to set the password only once: pragma password='pwd' insert into test values(encrypt('this is a test'), 'foo', 'bar') insert into test values(encrypt('this is test 2'), 'foo2', 'bar2') ... select decrypt(x) x, y, z from test where decrypt(x) like 'this%' Igor Tandetnik schrieb: Günter Greschenz <[EMAIL PROTECTED]> wrote: i'm using "sqlite3_create_function()" to create own functions in my database. this is a really nice possibility to extend the database with powerful functions. but i did not find a way to create own pragmas like "pragma foo=bar" to pass some global information to my application. Pass global information from where? Why would your application use such a roundabout way to pass global information to itself? If you need to store some global settings in the database, why not just create a table for them? Gunter, Igor is right, you should store your password in a table. If you are concerned about the password being saved in the database, then you could use a temporary table, or even attach a :memory: database to hold the table that contains the password. In any case the saved password is available to your encrypt and decrypt functions. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Re: creating own pragmas
hi, i implemented crypting for values: insert into test (x, y, z) values(encrypt('this is a test', 'pwd'), 'foo', 'bar') insert into test (x, y, z) values(encrypt('this is test 2', 'pwd'), 'foo2', 'bar2') ... select decrypt(x, 'pwd') x, y, z from test where decrypt(x, 'pwd') like 'this%' but setting the password each time is quiet time-expensive. so i want to set the password only once: pragma password='pwd' insert into test values(encrypt('this is a test'), 'foo', 'bar') insert into test values(encrypt('this is test 2'), 'foo2', 'bar2') ... select decrypt(x) x, y, z from test where decrypt(x) like 'this%' cu, gg Igor Tandetnik schrieb: Günter Greschenz <[EMAIL PROTECTED]> wrote: i'm using "sqlite3_create_function()" to create own functions in my database. this is a really nice possibility to extend the database with powerful functions. but i did not find a way to create own pragmas like "pragma foo=bar" to pass some global information to my application. Pass global information from where? Why would your application use such a roundabout way to pass global information to itself? If you need to store some global settings in the database, why not just create a table for them? Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Re: creating own pragmas
Günter Greschenz <[EMAIL PROTECTED]> wrote: i'm using "sqlite3_create_function()" to create own functions in my database. this is a really nice possibility to extend the database with powerful functions. but i did not find a way to create own pragmas like "pragma foo=bar" to pass some global information to my application. Pass global information from where? Why would your application use such a roundabout way to pass global information to itself? If you need to store some global settings in the database, why not just create a table for them? Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] -