Would be great to be able to Edit and Delete models with Recess Tools!
It actually would be even more cool if there were a way to save and restore "model preferences"...
e.g.
Tiger's Models List v1 (TMLv1.rml ~ Recess Modeling Language?)
-> Model=user
-> Table
-> isExists=true
-> dataSource=Default
-> table=users
-> Table Properties
-> id
-> pk=true
-> type=integer(AutoIncrement)
-> username
-> pk=false
-> type=string
...
Page 1 of 1
Request: Update and Delete Models Would be great to be able to Edit models with Recess Tools!
#2
Posted 04 October 2009 - 05:44 PM
It looks like Rails migrations for me
I like Rails migrations, but we use them in console. Now there is no such a thing in Recess. I don't see any advantages of adding migrations to Recess Tools. How to call them from shell or other script ? If you want to remove column all You have to do is remove it from model and table ( or You can even delete unused columns form database later ).
In fact it would be much better if there won't be full list of columns of table. I think we have this list, because is faster than generate them from 'DESCRIBE [tablename]' query.
In fact it would be much better if there won't be full list of columns of table. I think we have this list, because is faster than generate them from 'DESCRIBE [tablename]' query.
Yes, in Poland we have a internet connection ;]
#3
Posted 05 October 2009 - 01:23 PM
This is a longer term goal and should be possible (though, could break dependent code!). The biggest road block, currently, is a proper way of doing operations like these on SQLite databases. Their 'alter table' last I checked was nowhere near as pleasant as MySQL's. Does anyone have experience writing scripts that manipulate already created tables in SQlite?
#4
Posted 05 October 2009 - 01:30 PM
KrisJordan, on 05 October 2009 - 08:23 PM, said:
This is a longer term goal and should be possible (though, could break dependent code!). The biggest road block, currently, is a proper way of doing operations like these on SQLite databases. Their 'alter table' last I checked was nowhere near as pleasant as MySQL's. Does anyone have experience writing scripts that manipulate already created tables in SQlite?
Ah see, I guess a temp work around for that then could be something like:
- Backup table data
- Remove table
- Create table with or without new columns
- Restore the data of the columns that were not deleted
TM
"It's only work if somebody makes you do it"
"It's only work if somebody makes you do it"
#6
Posted 05 October 2009 - 01:54 PM
KrisJordan, on 05 October 2009 - 08:49 PM, said:
@TigerMunky - yes, I believe that is probably how it will have to be done. Any interest in prototyping the code for this?
I am on tight schedules but am willing to make an attempt during some spare time...
How do I get started?
TM
"It's only work if somebody makes you do it"
"It's only work if somebody makes you do it"
#7
Posted 05 October 2009 - 08:36 PM
KrisJordan, on 05 October 2009 - 08:23 PM, said:
This is a longer term goal and should be possible (though, could break dependent code!). The biggest road block, currently, is a proper way of doing operations like these on SQLite databases. Their 'alter table' last I checked was nowhere near as pleasant as MySQL's. Does anyone have experience writing scripts that manipulate already created tables in SQlite?
In fact alter table is not possible in sqlite. all you c do is to for example create temp table, like:
BEGIN TRANSACTION; CREATE TEMPORARY TABLE Bar(a,B); INSERT INTO Bar SELECT a,b FROM Foo; DROP TABLE Foo; CREATE TABLE Foo(a,B); INSERT INTO Foo SELECT a,b FROM Bar; DROP TABLE Bar; COMMIT;
it sucks but imo there wont be anything much better :/
Yes, in Poland we have a internet connection ;]
#8
Posted 06 October 2009 - 12:53 PM
Very helpful Rafal.
When you do an INSERT INTO filled by a SELECT is it just the order of the columns that matter or are you trying to match column names, too?
Scenarios we have:
* Add a column
* Remove a column
* Rename a column
* Retype a column (I realize SQLite doesn't care too much about column type other than integer autoincrement but Recess uses type info from sqlite as semantic sugar)
Rafal's snippet shows renaming a column. Rafal could you mock up the other scenarios, too?
This is looking less challenging than I originally thought, just need to create a wrapper around these operations.
When you do an INSERT INTO filled by a SELECT is it just the order of the columns that matter or are you trying to match column names, too?
Scenarios we have:
* Add a column
* Remove a column
* Rename a column
* Retype a column (I realize SQLite doesn't care too much about column type other than integer autoincrement but Recess uses type info from sqlite as semantic sugar)
Rafal's snippet shows renaming a column. Rafal could you mock up the other scenarios, too?
This is looking less challenging than I originally thought, just need to create a wrapper around these operations.
Page 1 of 1

Sign In
Register
Help


MultiQuote