Re: [sqlite] Hidding records from the application

2011-07-16 Thread Simon Slavin
On 16 Jul 2011, at 4:56am, san long wrote: > haha, if I CREATE VIEW in process A and DROP VIEW when A dies. Process > B could see this VIEW or not? > A and B run at the same thime. Process B can see the VIEW until process A DROPs the VIEW. On 16 Jul 2011, at 5:01am, san long wrote: > sqlite3

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Black, Michael (IS)
If each pid sees a completely separate set of rows then add the pid to each row and select by pid. If 2 pid's can see any of the same records this won't work (i.e. all pid's must be mutually exclusive) No views necessary but you could create a view for each pid if you wanted to for some re

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Igor Tandetnik
san long wrote: > It doesn't matter no application can see the underlying data as long as they > exist physically. I just want to hide them. If no application whatsoever can see them, what does it mean for them to exist? How can you observe the difference between records that exist but are hidde

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Igor Tandetnik
san long wrote: > right, but now I just want to hide these records to all processes. Just delete them. That would have the same observable effect. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/m

Re: [sqlite] Hidding records from the application

2011-07-16 Thread David Bicking
I don't know I have much to offer here as I still really don't understand what you are trying to accomplish. But I looked and it appears that sqlite supports TEMPORARY VIEW, which, I believe, is only visible to the process that created it. And it will automatically go away when that process end

Re: [sqlite] Hidding records from the application

2011-07-16 Thread san long
Thanks for replies. I want to make things clear. there are some rules in my system, such as : process whose name is proc_host can see all the records, and process whose name is proc_client1 can see all the records except rowid 1. It looks like temporary view and temporary table is good solutions,

Re: [sqlite] Hidding records from the application

2011-07-16 Thread David Bicking
Is an untrusted end user writing queries? Are there clients other than proc_host and proc_client1? If there is a proc_cleint2, would it also see all rows except rowid = 1? If there is only proc_clent1, then create a permanent view of: Select * from mytable where mytable.rowid<>1 But I deeply

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Stephan Wehner
On Fri, Jul 15, 2011 at 6:19 PM, san long wrote: > Dear all, > I have an idea related to the safety of the records in a table: if it is > possible to hide some records in a table so the upper user application could > not see them? > For example: > table food has content: > 1, "food A" > 2, "food B

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Simon Slavin
On 16 Jul 2011, at 5:18pm, san long wrote: > I want to make things clear. there are some rules in my system, such > as : process whose name is proc_host can see all the records, and > process whose name is proc_client1 can see all the records except > rowid 1. > It looks like temporary view and

[sqlite] Write locking - subquery

2011-07-16 Thread Kevin Martin
Hello, I'm just looking for some clarification of the documentation if that's ok. I did a quick search of the mailing list but couldn't find anything relevant. If I run an update query which has a subquery, will the database be locked before the subquery is run. I'm thinking something like

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Jean-Christophe Deschamps
>I want to make things clear. there are some rules in my system, such >as : process whose name is proc_host can see all the records, and >process whose name is proc_client1 can see all the records except >rowid 1. First, keep away of relying on rowid values since they may change if you don't cr

Re: [sqlite] Write locking - subquery

2011-07-16 Thread Kevin Martin
On 16 Jul 2011, at 21:30, Kevin Martin wrote: > insert into x values ('abc', -1); > update x set pos = 1+max(0,(select max(pos) from x)); Oops, deliberate mistake there. As I'm sure you all realise that should be update x set pos = 1+max(0,(select max(pos) from x)) where name='abc'; Kevin _

Re: [sqlite] Write locking - subquery

2011-07-16 Thread Simon Slavin
On 16 Jul 2011, at 9:30pm, Kevin Martin wrote: > If I run an update query which has a subquery, will the database be > locked before the subquery is run. Yes. The transaction does the locking. The transaction encloses the entire UPDATE. If you want to do the SELECT yourself as a separate s

Re: [sqlite] Hidding records from the application

2011-07-16 Thread san long
It seems that my words are still ambiguous, let me make it further clear. there are many processes in the system (ie, linux ), they use the sqlite databases, I add many rules to allow/forbidden their access to the databases, such as: "A" (process name) can see all records except rowid 1,2 "B"

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Simon Slavin
On 17 Jul 2011, at 4:03am, san long wrote: > (process name) Implement this logic in your programming language, or do it by having your app consult a table to see what has access to what database. SQL is a database language. You put data in and get the same data out again. You don't get diff

Re: [sqlite] Hidding records from the application

2011-07-16 Thread san long
actually I don't know how to get my rules yet, but let's assume the rules exist and we can get it from a function. get_forbidden_ids() 2011/7/17 Simon Slavin > > On 17 Jul 2011, at 4:03am, san long wrote: > > > (process name) > > Implement this logic in your programming language, or do it by hav