Doctrine: can I use SQL to create my tables? - database

I'm looking at exploring Doctrine. Seems like the examples I have found assumes Doctrine will create the tables I need. I like to design my databases using MySQL Workbench. Can I just give the MySQL create script to Doctrine?

if you use Doctrine2 ORM you should forget about sql totally. ORM is object relational mapper in its nature all you should know about is your objects and relations between them. And I think that answers your question. If you use ORM design your database using objects, not sql.

You can use our tool Skipper - formerly ORM Designer to design visual representation of the objects and their relations, fill in the ORM properties and then generate complete schema files directly from the visual model (I'm chief developer of this tool).
You don't have to deal wit the SQL and actual database level, it will be taken care of by Doctrine or Doctrine2.

Related

Is there any database model having these "no-sql", "schema free" & "relational" ? is it support c++?

I need schema free db with relational features for my C++ application.
I already using PostgreSQL and Mysql in my project.
I want to store data relationally in document and need CRUD using SQL.
"Relational" and "schema-free" are mutually exclusive.
Modern DBMS support several data models. For example, SQL Server supports relational, document-oriented (both XML and JSON) and graph (network) data models. You can combine the use of different models in the same database. A typical example, the table of documents contains several columns corresponding to most important attributes including the keys, and one column that stores an XML.
However, the relational data model is well structured by default, so it's hard to implement a schemaless relational database. This may be simulated with Excel sheets or tables using only some "variant" data type but such a solution seems to be fragile and has performance issues.
Another way is to use EAV extension inside a relational database.
You can have a look on "Programming with databases" book containing some examples of use Yes/NoSQL.
Please take a look at AgensGraph database. AgensGraph is the only true multi model database supporting Relational Database and Graph Database(Schema Free). It is as well supporting Key-Value and document model. Also its based on C language.
AgensGraph
The actual answer to your specific question based on your parameters:
Schema free
CRUD support
SQL "like", aka Relational
C++ support
is ArangoDB.

Is there a visual modeller which supports opennetcf.orm which can also map existing databases?

With OpennetCf.ORM I can define entities and their relationships in C# classes, is there a way to create these entities and relationships using a more visual modeller, perhaps one which can also map existing Microsoft SQL tables?
Use the EntityGenerator tool that is part of the release: http://orm.codeplex.com/releases/view/82434

How to use Visual Studio for diagram-first database design and generation if I don't want to use Entity framework?

I just want to "draw" a database structure and generate an SQL script to create all the tables and keys (the way I used to do with ERWin and MySQL Workbench). And I don't want any ORM classes to be created (as I am going to do all the database querying manually). How to achieve this?
Not being familiar with the mentioned tools, are you looking for Database Diagrams

Create Sql Database Tables from Business Objects

What is the best way to create Sql Server tables from business objects. For example I'm writing an application that has a user object to store user information. What's the best practice for creating tables from these objects? Create the objects first and then define the database or is there a tool to transform business objects into tables?
I'm just curious how others are doing this type of task.
Use an ORM (object-relational mapping) tool, a list for tools for several languages can be found here: http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software
We are using NHibernate. It allows to write classes first, map them to the database by configuration (mapping files) and generate the database tables from that. It also allows restructuring the database (eg. for optimization) without touching business logic at all.
Of course, you still need to care about existing databases (schema migration).
There may be other ORM which have similar functionality. NHibernate is one of the most powerful.

Way to abstract database schema creation?

I'd like the ability to create a schema for multiple database types such as MySQL, SQL Server, and PostgreSQL. I know ORM tools such as Hibernate can do this, but I won't be using an ORM to access the database so would like a solution that doesn't depend on one. Are there any tools that can do this?
Edit:
I forgot to mention that this is a personal project so I'm looking for something either cheep or free.
Take a look at Erwin.
Edit: (Based on question update)
Yeah Erwin is not going to be cheap. I did a quick search and found Toad Data Modeler, which I haven't tried but may be worth looking into:
Entity relationship diagrams - both Physical and Logical modeling (incl. inheritance)
Support for various databases (Oracle,
MS SQL Server, MySQL, Sybase Ase,
PostgreSQL, DB2)
Generation of SQL (DDL) scripts
More...
SQL Power offer a FOSS modeling tool, SQL Architect. It can generate DDL for several flavours of database. It is still technically beta (current release is 0.9.1) but it should be fine for a personal project. Find out more.
I know you said u don't want an ORM but SubSonic 3's migrations might just do the trick for you. You don't have to use the ORM just have SubSonic build itself from your database and have it as a separate class library. Then change the provider say from MSSQL to MySQL and have it rebuild itself.
PowerDesigner is a far better choice than Erwin but it too is expensive.
It took me roughly 16 hours to install the demo of Erwin, lots of failed attempts, incomprehensible error messages, help phone number which were disconnected.
PD will give you 14 day free trial.

Resources