Show tables ? + 2 Feature requests
Bart Pietercil
bart.pietercil at gmail.com
Wed Sep 19 08:06:24 CDT 2007
On 19-sep-07, at 14:45, Ivan Smahin wrote:
> Hello Bart,
>
> Wednesday, September 19, 2007, 3:05:47 PM, you wrote:
>
>> Hi List, Ruslan
>
>> 1) When running the "show tables" command, the query result also
>> includes VIEWS.
>
>> Is this by design or a bug. If by design I would suggest updating the
>> WIKI with the explanation that not only tables are included (as it
>> states now) but also views.
>
> Yes - it is a feature. Of course WIKI must be up to date.
> BTW, now it is possible to filter show results as usual -
> for subquery results:
>
> Example:
> SELECT * FROM (SHOW TABLES) WHERE type = 'TABLE'
OK, nice
>
>> 2) Feature request: When running the show tables query the result
>> includes a field called text where , for views, the create statement
>> is stored.
>> Would it be possible to do the same (store the create statement in
>> the text field) for tables. This would make it easier to copy tables
>> from one db to another, instead of dumping a table to disk (sql) and
>> the opening the .sql file copying the create statement and pasting
>> this in the SQL editor.
>> I do realise that the create statement would need to include the
>> alter table statement in order to define the links.
>
> Strictly speaking - it is impossible. Look - there is a single
> way to
> create an view - CREATE VIEW statement. But it could be some
> dependency for the tables.
> Example: Assume we have two tables t1 and t2. T2 has ObjectPtr pointed
> to table t1. Now you want to get a single statement which can be used
> for t2 creation. Something like this:
>
> CREATE TABLE t2 ( fPtr ObjectPtr REFERENCES t1 ON DELETE SET NULL );
>
> But there is no guarantee that table t1 exists - right?
> So it is not so simple and can not be expressed in a single statement.
> You can try to make SQL dump for some database and you will see -
> there are some "ALTER TABLE" statements presented in most of cases.
>
Agree, but it still would be handy. I mean now I dump the db and by
hand collect all relevant statements to rebuild a table in another db.
So in SQL Editor I get
create .....
alter objptr.... constrain
for each objectptr and I verify if tables that are referenced exist
in the new db
It would be handy to collect these statements with one click and then
paste the result in the sql editor where they can be edited and
modified where necessary
>
>
>> 3) May I repeat an earlier FR to have the possibility to include
>> comments for all Valentina Objects (Table, Field, Link, Method). I do
>> realise that this is overkill for most projects, but I can assure you
>> that having this for big projects where multiple people are working
>> on a common database, this feature would be very welcomed. I am sure
>> PostgreSQL has it and I think this is also true for other major db
>> engines
>
> Instead of having just a comments we are going to implement
> more common thing - "properties". It would be system properties, says
> properties which are most common for particular object kind (Obviously
> 'comment' is kind of such property) and UDP (user-defined properties).
>
>
Super COOL; this means I can assign status property (finished, in
development) and category to tables. Please make it so that we can
have popup's to choose from when we 'set' a UDP (enums ?)
Thx
Bart Pietercil
More information about the Valentina
mailing list