Dear SQLiters, I can not add solutions, since I am a physicist designing database for the first time, but I would like to add questions...
Object-relational mapping (ORM) is a new and interesting concept for me that I learned. I will read about it more. However, I do not understand why new functionality of SQLite is needed. Why can't the mapper use a special table of three columns (I will use example from Alexey): tableName | columnName | Rule -------------------------------------------- user | username | TITLE user | login | KEY user | roles | LIST:role (This table describes all classes, "user" being one of them. Perhaps another table is needed to keep track of instances of the classes.) My question is (an it intersects with another topic discussed recently: security) how safe it is to store SQL instructions to be executed in such tables, say in the rule column? Name of some scripts to be executed? Class is a collection of data and methods to operate them. Database is clearly designed to store data, and relations. What about operations? Is it, in general, a good idea to store SQL statements and script names to be called even if security is not an issue? Can someone recommend an ORM? What are the pros and cons of using them? If this list is inappropriate for such discussion, please also let me know and I will refrain. Thank you, Roman ________________________________________ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Alexey Pechnikov [pechni...@mobigroup.ru] Sent: Friday, June 14, 2013 12:47 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Feature request: add support for COMMENT statement Hello! > Suppose you have it. What would you do with it? > What's the use case? > --> Igor Tandetnik The COMMENTs can be used to store any information for interchanging with application and external systems. As example, ORM (object relational mappers) may need some additional metainfo for all mapped columns: My web-apps use metainfo like to: user { username TITLE login KEY password PASSWORD roles LIST:role note HIDDEN modified TIMESTAMP author ID:user isactive ACTUAL } Where user - table name username, login,... - table fields TITLE, KEY, PASSWORD - definition for rules to process tables fields in web application and in console (import/export utils). The database schema (including tables, indicies, FTS indicies tables, etc.) is generated by this metainfo too. So I have the high-level domain specific data definition language and low-level application file format as SQLite database. Of course, it's usefull to have auto generated schema with records versioning for all tables, fast search for all key/title fields using FTS extension (my patches add snowball tokenizers support), fast search for lists of identifiers (using FTS extension too), import/export utilities, JSON routes, etc. Unfortunately, now we need additional external [plain-text] file with metainfo or additional table with non-trivial and non-standard mapping between database objects and own metainfo table records. > SQLite saves comments in table/view/index/trigger definitions: > > sqlite> create table t(x /* :-) */); > sqlite> .schema > CREATE TABLE t(x /* :-) */); > > Regards, > Clemens Bad idea. The schema definition can't be modified! -- Best regards, Alexey Pechnikov. http://pechnikov.tel/ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users