Re: [sqlite] "Tagging" SQLite tables with attributes for introspection.

2018-04-21 Thread R Smith

This works for me:


DROP TABLE IF EXISTS processing;
CREATE TABLE processing(
  tableName TEXT NOT NULL PRIMARY KEY,
  touch_me_please INT DEFAULT 0,
  Ive_been_touched INT DEFAULT 0
) WITHOUT ROWID;

INSERT INTO processing(tableName)
SELECT name FROM sqlite_master WHERE type = 'table';

Hereafter, updating and referencing the "processing" table is simple.


On 2018/04/21 12:52 AM, Randall Smith wrote:

I'm writing some code to do processing of some (but not quite all) of the 
tables in my SQLite database.  I could make this a lot easier and more general 
purpose if I could somehow attach an attribute to the various tables that 
indicated whether that table should be processed.

Other than, say, keying off something in the table name or something which is a 
pain because all the table names are already set in stone, is there any way 
good of doing this?  I was hoping there was something in, say, the 
sqlite_master table I could intentionally affect and then use later.  But 
nothing jumps out.  Maybe define some kind of bogus index for the table I could 
check for?  But I'm hoping there's something with more grace and beauty.

Thanks for any ideas or suggestions.

Randall.

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] "Tagging" SQLite tables with attributes for introspection.

2018-04-20 Thread J Decker
You could make a extra table that has a foreign key on sqlite_master and
add extra attributes...
You could add comments  ( -- ) in the create statemtents; and parse those
back out ...


On Fri, Apr 20, 2018 at 3:52 PM, Randall Smith 
wrote:

> I'm writing some code to do processing of some (but not quite all) of the
> tables in my SQLite database.  I could make this a lot easier and more
> general purpose if I could somehow attach an attribute to the various
> tables that indicated whether that table should be processed.
>
> Other than, say, keying off something in the table name or something which
> is a pain because all the table names are already set in stone, is there
> any way good of doing this?  I was hoping there was something in, say, the
> sqlite_master table I could intentionally affect and then use later.  But
> nothing jumps out.  Maybe define some kind of bogus index for the table I
> could check for?  But I'm hoping there's something with more grace and
> beauty.
>
> Thanks for any ideas or suggestions.
>
> Randall.
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] "Tagging" SQLite tables with attributes for introspection.

2018-04-20 Thread Randall Smith
I'm writing some code to do processing of some (but not quite all) of the 
tables in my SQLite database.  I could make this a lot easier and more general 
purpose if I could somehow attach an attribute to the various tables that 
indicated whether that table should be processed.

Other than, say, keying off something in the table name or something which is a 
pain because all the table names are already set in stone, is there any way 
good of doing this?  I was hoping there was something in, say, the 
sqlite_master table I could intentionally affect and then use later.  But 
nothing jumps out.  Maybe define some kind of bogus index for the table I could 
check for?  But I'm hoping there's something with more grace and beauty.

Thanks for any ideas or suggestions.

Randall.

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users