Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ability to create sql tables/columns from a DataSource?

    Does Smartclient offer anything like the inverse of autoDeriveSchema? That is, take a list of fields and a table name (e.g., from a .ds.xml) and attempt to create a table in the database I've defined in server.properties? I'm not sure if I would use something like this in production, but I'm interested in playing with such a feature.


    e.g., in grails, I can create a DomainClass, add fields to it, even some validations, and it'll use hibernate to go off and update the DB to match it.

    I couldn't find it, but thought I'd ask to be sure. Thanks!

    #2
    Yes, you can run an "import" of a SQLDataSource in the Admin Console to do this. It will import the sample data defined for the DataSource as well, and that latter feature works for any DataSource.

    You can also, of course, use Hibernate to do this, and connect a DataSource to the Hibernate bean once created, using autoDeriveSchema to avoid having to hand-create field definitions in the .ds.xml file. But we recommend the SQLDataSource over Hibernate as it is much easier to customize SQL, do custom queries, etc.

    Comment

    Working...
    X