WWW SQL Designer
Hello and welcome to WWW SQL Designer documentation. This page will hopefully help you with understanding how WWW SQL Desginer works and how can it be tailored to suit your needs.
Browsers
WWW SQL Designer was tested in the following browsers:
- Firefox 2.x+
- Internet Explorer 6-10
- Safari 3-5
- Opera 9.x+
- Konqueror 3.5.x
- Chrome 3+
Konqueror is the only browser (from this list) which lacks support for Smooth connectors and XSLT transformations (creation of SQL scripts).
Basics
The application allows you to:
- Draw E-R designs
- Edit tables and rows
- Manage keys
- Create relations (FK constraints)
- Save & Load designs
- Import DB schemas
Most commands are intuitively available from the right sidebar. Some additional tasks are described below:
- To drag a table, press mouse button while pointing at table header. You can then move the table around the canvas.
- To edit table properties, either double-click its heading, or select it and then press 'Edit table' button in sidebar.
- To edit field properties, either double-click it, or select it and then press 'Edit field' button in sidebar.
- To manage keys for a table, select a table and press 'Edit keys' button in sidebar.
- To draw a connector (relation), first select a field which forms a Primary Key. You then have two options:
- Either click 'Create foreign key' button in sidebar and click target table's heading. New field and relation will be created;
- or click 'Connect foreign key' button in sidebar and click target table's field. New relation will be created.
- To perform any kind of save/load/export/import task, press the 'Save/Load' button in sidebar. A dialog window will appear, allowing you to perform clientside or serverside tasks. If you wish to use a server-side backend (for instance, to save your design into a database table), make sure the backend is properly configured.
- Example: The php-mysql backend stores designs in MySQL table. First, it is necessary to prepare the storage table (its definition is available in backend/php-mysql/database.sql); second, connection credentials must be entered into backend/php-mysql/index.php.
- To automatically load a saved schema (using default database backend), append "keyword=xyz" to URL, substituting "xyz" with the name of your saved schema.
- To start with toolbar minimized (hidden), append "toolbar=hidden" to the querystring.
HEllo,
Can't save anything...
Thx
Hello,
please provide more information about version, used backend and error messages (if any).
How I save files : # check that you server have write permission in sqldesignor's directory # I use the method php-file
When it's done, you can find your save in sqldesigner/backend/php-file/data
I hope it can help you
how to delete relations:
when i add a table and type in the description and then hit "enter" I get an "AW SNAP" error page in google chrome. if I click the "ok" button, i don't get the error
How do I import a schema from a ddl script ? Ie I want to have an ER diagram from a sql script file that contains all my table definitions. Thanks.
Please see http://code.google.com/p/wwwsqldesigner/issues/detail?id=4 - create an appropriate import-capable backend to achieve this.
I have the /php-file/data as 777 and still does not save.
Please help
Rick
it just doesn't work. I cant import a thing... no databases (mysql) no sql scripts nothing. what are you guys working on if your software just doesnt work ?
@csharppoet It's a work in progress, don't like it? Don't use it, simple as that.
@csharppoet To import a database schema, make sure you have a working php+mysql environment and setup your DB connection in backend/php-mysql/index.php. If this does not work, please provide us with an error report (for instance, the output of the relevant ajax call) instead of plain trolling. Thanks! :)
I have the /php-file/data as 777 and still does not save.
@laucode - if PHP is in safe_mode, your file must be owned by the process of web server. If this still does not help, you will need to provide some debugging output (for instance, the result of relevant ajax call(s)).
This is a brilliant tool (and it saves and loads perfectly for me without any issues).
Great piece of software.
hello ! how to delete a foreign key ? thanks
Click on the foreign row and select "Remove field" button. Removal of the connector line (without field deletion) is on the tasklist.
Amazing tool and code
Excelent. I use it for the begining.
The online demo doesn't create a new field and relation when clicking 'Create foreign key' button in sidebar and click target table's heading.
Yes, this is a bug. Will fix it asap.
when trying to import from DB (using php-mysql) it says: XML error: null document.
all the other functions (load, save, list) are working perfect.
What I'm trying to do is to import a database in the sql server.
very nice work!
The XML generated by importscript is probably not valid. What are the contents of /backend/php-mysql/?action=import&database=yourDBname ?
Realy great Work. Thank You. We are molding it to new needs and we are pleased with what we are seeing! We have 2 plans: .Enlarge designer-zone .Write a Oracle-Xe 10g connector. Keeping in touch.
ok. stage 1 done. We have a "Zone" 5000px by 5000px and an easy hundreads of tables... The system answer time like open. load, scrolls are visibly slow. It is not because of the cpu power (2.4 GHz and 1 GB Ram) but because of Video Card that seems manufactured by the Brothers Lumière. Changes: (for a static zone) - file ./styles/styles.css - paragraph : #area - lines : 6,7,8
Next News : The oracle connector-XE 10g.
Again, thank you guys. great work. Lorenzo.
Hello, How to create a foreing key when the primary key are two fields ?
CREATE TABLE table1 (
);CREATE TABLE table2 (
);ALTER TABLE table2
I am afraid that this is currently not posible, because FK constraints are created between two columns (correct would be column and a key).
Great tool. Installs and saves/loads fine if you are equipped with a standard brain. Thank you. (Add the ability to remove a connector line and I'll thank you again :-) )
Great work! i just like it to have support for oracle sql.
I too am having problems with the import from DB in mysql-php. The action statement above gives: Index of /wwwsql/backend/php-mysql Parent Directory database.sql index.php but I see no XML! Also if I try to execute the query "SELECT FROM TABLES WHERE TABLE_SCHEMA = '".$db."'" This doesn't seem to return anything. I assume the information_schema db is used prior to this call but where? /steveA
If you see only the directory listing, you need to setup your webserver to use index.php as a directory index file.
Apparently, I do not have a standard brain. It's a great tool but I also am having prob's with Load/Save. I am running F'fox3.5 on a Mac 10.5, the files are in the 'Sites' directory and the backend dir is set to Read&Write for everyone. When I try to save I just get an endlessly spinning gearwheel..... Apologies for my denseness
To save and/or load, one must have a properly set up webserver with PHP support and MySQL database (if you choose to use the php+mysql backend). I do not have access to Mac platform right now, so I am unable to provide more detailed assistance :-(
Ondrej - thks for the swift feedback - i can have MAMP running in the background but do not see where to go to link the two elements (MAMP/SQLD) I would be content just to save as a file.... O'wise it's just marvellous
The php+mysql backend is realized via HTTP requests to /YOUR_WWWSQL_INSTALLATION/backend/php-mysql/index.php file. This file must be interpreted with PHP. Also, your MySQL must be correctly set up with a table - the definition is in backend/php-mysql/database.sql. Finally, in the index.php file, you must properly configure the database connection credentials.
Of course, you are free to use any other available backend, e.g. the php-file. In this case, MySQL is not necessary.
And then, there is no need to use DB backends at all - just export your design as XML and save it to file via clipboard. No configuration necessary :)
Ondrej - Thks again for the feedback
I have amended the index.php file to include the username & pwd for MAMP in several places (lines 5,6,12,13 & 17) - is this correct
re the mySQL part of MAMP - this needs to have a table with the definition shown in 'database.sql' - is this a standalone db or part of the db i am working on ??
Apologies for the denseness of my Q's. AD
The DB used for design storage is not related at all to the DB you are designing. No problem with questions, but I will be gone for 3 weeks starting from tomorrow :)
Sorry but what should "The DB used for design storage" be called
Enjoy your hols
So I now have
1) a DB called 'WSD' running under MAMP w a table 'wwwsqldesigner' as per the file 'database.sql' in the 'backend/php-mysql'dir.
2) the file 'index.php' in the same dir amended to show the correct u'name,pwd & DB. (changes on lines 5, 6, 12, 13, 17 & 19)
Q - is this file in the right place?? Q - DB save under 'wwwsqld..' should show up in 'WSD' as data - yes??
All files are in right places in default wwwsqldesigner installation. There is no need to move them around.
If you save your DB design via the "php-mysql" backend, your design will be added as a new data row to the 'wwwsqldesigner' table. If unsure, just use the Firebug tool to monitor the XHR traffic.
thks for that - hope you have a great hol - 3 wks! marvellous
meantime i am getting this errmsg from Firebug
URI denied" code: "1012 on this error? xhr.send(o.data || null);\noz.js (line 213)
Anyway I will fool around until I break something will talk in 3 wks - enjoy Really thought that i had the permissions thing sorted Its still a really cool tool!!
great work. How to start with a default design to show? And how not to let people overwrite it? (just like demo)
How to Import from DB (my database is Oracle xe) . Pls tell me the solution as early as possible, its urgent.
arthur.doohan - please send me a screenshot showing the issue
famiglia.invernizzi - default design via ?keyword=name_of_default
hydsea - you need an oracle-based server endpoint with import capabilities. There is no such endpoint at the moment; someone has to create it.
I have a problem with the import from MySQL-DB: Loacal is running XAMPP for Mac (with the defaults "root" and pw ""). The /backend/php-mysql/index.php beginn:
If I open the window "Save/Open", press the button "Import from DB", write the name of a DB and press the button "Ok" all windows closed and i have the start-window. No comments, nothing. What can I do?Please watch the traffic (via Firebug) and send me the info about what is happening in the background. Use e-mail/google groups for this.
great tool!!
Thanks. It's simple and easy to use. Good for initial proposal designs.
Hi, Its an amaizing tool. Howver, I came acroos a doubt? Ive mapped fields of 2 table using foreign key and obviously, I can see a black line connecting between the 2 fields. Now, suppose i dont want that foreign key mapping. How can i remove the mapping?
Hope i didnt make it confusing. Thanks.
Hi,
removing a relation (without removing the relevant field) is on a list of acknowledged tasks.
Thanks for the reply. Does that means I can only remove the black-line via deleting the field and re-creating it? Am i correct?
Currently, this is the only way.
It seems that it does not work in IE7 when moving the boxes around. The connector did not adjust automatcailly. Is there any reason? Or Am I missing something? Thanks in advance. Anyway, it is a awesome tool.
Moving boxes around works for me fine in IE6, IE7 and IE8. Can you please try also in IE8 in its IE7-mode?
very nice tool! keep up the good work.
E7 mode in IE8 is working fine after installing IE8. However, it's running fine on the online version. When I downloaded the wwwsqldesigner-2.3.3.zip, then open the index.html locally in IE8 or IE7 mode. It gave me the error saying that "Access is denied. oz.js Line:195 Char:3". And the menu to add the tables did not show up. Anyone is having the same problem??? Thanks again.Since I am actively investigating this app.
Did anyone perform "import from DB" successfully??? I have changed the connect config in php-mysql/index.php...but still did not work...any advice will be greatly appreciated. Thanks.
To solve the DB import problem, please let us know how does the AJAX communication relevant to the import request looks like. Use some tool like Firebug to see what exactly is going on, if the import.php is executed and what is its output.
Hi all, First this is a very nice tool. I used the Firebug to step thru the demo. I am wondering how you decide the X and Y position in the first place for all the boxes(i.e. table entities). I checked the value of the varible "data" after this line "xhr.send(o.data || null); " ..in line 212 of oz.js....the XML returns from the response already contains the e.g. <table x="389" y="357" name="PERSONAS">.. i'd like to see how you calculate those values and where ?? Any explanatiaon will be helpful...thank you very much...
Hi,
table positions are stored in saved xml file. When creating new tables, the user controls (using the mouse) where tables are placed.
but how about the diagram created "import from DB"...just like the web demo. I will assume, once the DB schema is loaded. (I can see the XML file is created in perl withouit X and Y info based on the schema)...then somewhere/somehow in the wwwsqldesinger will calculate the X/Y position and added it to the XML. This is the part I couldnt' figure out...Thanks again.
Hi,
imported schemas are repositioned the same way the "Align tables" button works. It is a trivial grid alignment code, see http://code.google.com/p/wwwsqldesigner/source/browse/trunk/js/wwwsqldesigner.js line #2182 (function alignTables).
ondrej, I really appreciated for your quick response. Ok. 'alignTables'. I got it. However, in your online demo, it seems that the tables are not aling using 'alignTables' function..as I can easily see the positions when first loading your web demo. The boxes' position are more "random". But it turns out very good looking(no overlap). That's basically was my 1st question in place that where/how you align up so nice when loading your web demo. Thanks.
Becuase what I am trying to do it somehow feed the XML markup to your page then ER diagram will be displayed with nice alignment automatically. Thanks again for your excellent work.
Vincent,
the demo page (http://ondras.zarovi.cz/sql/demo/?keyword=default) is not an import, it is a saved design - with tables already placed (by its creator). Therefore, the design contains coordinates for all the tables.
oic. I thought the demo data is retrieved everytime from the DB. I totally understood now. Thanks.
I'm getting some javascript errors when I host the page (version 2.3.3) on my local machine. I can play with the GUI just fine, and the save client stuff works just fine, but when I try to play with the server stuff using the perl-file backend (I don't have PHP installed on my local machine, so...), I get:
Error: uncaught exception: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "file:///C:/Program%20Files/wwwsqldesigner/wwwsqldesigner-2.3.3/js/oz.js Line: 213"]
That's under Firefox 3.5.3. I don't think there are any addons installed.
Under Chrome, the input/output window has, after running the list command (just copy and pasted here:) <!DOCTYPE html> <html> <head>
<script> function addRow(name, url, isdir, size, date_modified) { ... lots more code... </script><script>i18nTemplate.process(document, templateData);</script><script>start("C:\\Program Files\\wwwsqldesigner\\wwwsqldesigner-2.3.3\\backend\\python-file\\");</script> <script>addRow("..","..",1,"0 B","10/28/09 6:58:34 AM");</script> <script>addRow("index.py","index.py",0,"440 B","10/28/09 8:49:34 AM");</script>
I'm not sure how to check for errors with chrome.
Internet explorer won't even load the GUI part, I get this error as soon as I load the page and enable dynamic content:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618) Timestamp: Wed, 28 Oct 2009 23:29:24 UTC
Message: Access is denied.
Line: 195 Char: 3 Code: 0 URI: file:///C:/Program%20Files/wwwsqldesigner/wwwsqldesigner-2.3.3/js/oz.js
...
Again, this is just running on my local machine. It's not built to be a web server or anything, so maybe there's just something not installed? PHP certainly isn't installed, for instance. I installed perl just to try out the perl-file backend.
Any insights would be appreciated.
You are probably hitting the cross-domain request restriction. All requests from a webpage MUST be directed to the same domain.
So something with the backends accessing the file system is causing the problem? I'm guessing that this isn't something that would happen on a server, though?
Let me explain what I want to do and maybe you can help...
I'd like to somehow use wwwsqldesigner to allow other programmers on my team to update the database schema. Which means I want to be able to save (and load) a .xml file of the schema on the different programmers' machines, and then each of them can check in that .xml to our versioning system (perforce) if they make changes.
Then, in a table creation script, I want to convert that xml to an actual SQL query and run it on some given MySQL database.
Ideally the xml and the database couldn't get out of sync, so I was thinking of gutting the server save stuff so that instead it saves a file to the "server" (really a place on the client's machine where they've checked out our project) and also sends the SQL query to our database, which I can just hard code the login details for inside whatever script.
There would still be a danger of someone updating the database and not checking in the xml, but the database's data can be regenerated from scratch in a few days if we need to, so it wouldn't be that big of a problem.
I'm not a javascript, perl, python, PHP, or html wizard at all, and I really don't understand web technologies. So forgive any obtuse questions I might ask :) In your opinion, what's the best way to approach this? I can install wwwsqldesigner on our local intranet web server if need be, but I really need to be able to save a .xml file to the local machine of users so that they can easily check it in to perforce.
I've thought of copy+paste from the input/output window, but I have to sell this to the other designers so it needs to be as frictionless as possible.
http://cakeapp.com uses WWW SQL Designer. It is a community to create and save db schemas. It allows also to create a website out of the schema.
I set up the IIS on my local machine and copied wwwsqldesigner to C:\inetpub\wwwroot\ (which apparently gets created with you install IIS?), and I can sort of get it working but I'm still getting some errors.
I can use php-file to load and list just fine. However, when I try to save, it says "Server response: Saved" but the file does not show up in either windows explorer or the "list" button. I can load the default schema, though.
Any ideas how to debug this?
Hmm, seems to work now, so I'm not sure what the problem was before.
Anyway, for the curious, I made this little batch script to automatically register the current directory as a virtual directory on the IIS server (7.0):
And then redirect.html simply points to the proper place on the local host:
Muy interezante aplic, muchas gracias
Is there any way to specify the set of valid values for an ENUM?
Just enter them to the "size" field (also known as "stuff in the round brackets after column definition")
Hey, great tool. i was wondering in terms of displaying the ERD diagram via widget on another webpage. it is possible to embed the existing canvas? or has any thought been given to exporting the disgram as a SVG diagram, which then could be embedded on a page. Regards, P
Export to SVG sounds nice, but is far more complicated that it may seem. Only the lines (connectors) are realized via vector graphics; tables and their content are traditional HTML elements without any canonical SVG representation.
I am trying to 'import from db' a php-sqlite db and am getting nowhere. Can anyone help? It just 'hourglasses' forever. Let me know what I can supply you with to help me. I read this document and most of it is regarding MySQL.
I believe that the php-sqlite backend does not support importing. If I remember correctly, the only backend with implemented import is php-mysql.
Hi, Thanks for this useful tool. I'm very new to DB design and all has worked fine (except that it took a while before I realize that "save" doesn't mean a dialog will appear). Just had a little difficulty with quoted words inside quotes; I have to put "\" like: "plaisir d\'amour", otherwise phpMyAdmin doesn't accept it.
Thanks again
Philippe
Excellent tool, thank you very much!!!
I still have one problem. Import/load/save from DB are working fine. XML Save is also working.
The problem is in generating SQL code for the table definitions. I get the error
XML error: Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIXSLTProcessor.importStylesheet]
Not really sure where to begin with this one.
Am I missing something or is it possible to use the XML definitions to create the tables in the DB ?
I'm using firefox 3.5, MySql? 5.0.67 and Suse 11.1
Thanks for any help
Hi, please tell us what DB datatypes do you use (Options -> Database for new designs). Also, does the problem happen on the sample database view, the http://ondras.zarovi.cz/sql/demo/?keyword=default ?
Thanks for the quick response.
The options is set to mysql. The problem does NOT occur with the sample database. In that case I get the SQL output.
Not sure if this plays a role, but i've tried to set all my collations to be unicode. UTF-8 charset and utf-unicode-ci for the tables and fields.
The problem occurred in the latest version 2.4. I've also checked out the most recent SVN read-only version and the problem still occurs.
Ok, please use Firebug to see if the .xsl template necessary for SQL statement creation is fetched properly. The requested file should be "db/mysql/output.xsl".
I've test a couple variations and determined that the XSL that my browser recieves has one difference. On line 96
the '=' character is missing.
The file "db/mysql/output.xsl" on my local server contains the '=' character.
When I compare the response from the demo application with my local server copy of "db/mysql/output.xsl" they are identical and the SQL generation works. Only when I get the response from my local server is the '=' character missing in the response.
I thought it may have something to do with PHP short tags which I have activated but I changed this and the error still occurs.
This is a strange problem.
Here are the request and response headers for the request as seen in firebug
Response Headers Date Tue, 01 Dec 2009 08:09:02 GMT Server Apache/2.2.10 (Linux/SUSE) Last-Modified Thu, 05 Nov 2009 08:03:54 GMT Etag "64371-df8-4779b2b200e80" Accept-Ranges bytes Content-Length 3576 Content-Type text/x-xslt Request Headers Host ahp3 User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.0) Gecko/20090623 SUSE/3.5.0-2.1 Firefox/3.5 Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://ahp3/sqldesigner/ Cookie fe_typo_user=41bfbb95d9
I've also just compared the headers I get from the demo with the headers I get from my server and discovered that the response header content type differs. The length of the response differs also by one byte but this is likely due to a new line at the end of the file.
From Demo: Content-Type application/xml From my server: Content-Type text/x-xslt
Any idea what's going on here ?
The missing '=' character is no longer a problem. This was caused by my browser using presumably an older cached version of the file. Now the only difference seems to be the content type.
Problem solved. :)
After reading http://www.se.eecs.uni-kassel.de/~thm/Linux/mozilla-xml-xsl.html and http://www.ibm.com/developerworks/xml/library/x-tipapachexhtml/index.html
I wrote a small .htaccess file and placed it in the "db/mysql" directory.
RewriteEngine on RewriteCond %{REQUEST_URI} \.xsl$ RewriteRule .* - [T=application/xml]Now the SQL generation works.
Not sure if this is the best way to solve this problem but is a functioning workaround.
The missing "=" is just some fixed stuff present in latest SVN revisions.
JS unfortunately needs all XML files server with text/xml or application/xml, so your workaround is certainly the best you can do, given these circumstances. Congratulations :)
Every time I use the 'generate mySQL' button I copy and past it into my SQL box on phpMyAdmin and it comes back with the following error:
"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''users' ( 'userid' INTEGER AUTO_INCREMENT DEFAULT NULL , 'username' VARCHAR(20' at line 1 "
Granted, I had to fix the apostrophes as the generated ones weren't 'real' apostrophes, hopefully you know what I'm talking about. Any help would be appreciated, love this tool.
--
Greg
Greg,
do you use a downloaded version or the online demo? Can you paste the generated SQL code?
O.
Hi. I have set up an Apache-PHP-MySQL server, and I can save/load ER diagrams generated by the ajax tool. But I cant import my previously existing MySQL schemas. I think it is the same trouble reported by sralp...@charter.net, Aug 01, 2009 (I couldnt find an answer to that message)
When I call this URL: http://localhost/wwwsqldesigner/backend/php-mysql/?action=import&database=myDB
... I get this output:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\WWW\wwwsqldesigner\backend\php-mysql\index.php on line 38
It seems to me that line 37 of /backend/php-mysql/index.php defines a SQL SELECT query on a table that simply does NOT exist: $result = mysql_query("SELECT FROM TABLES WHERE TABLE_SCHEMA = '".$db."'");
In my case, $db would take the value "myDB" ... but this schema has not a table called "TABLES"
And also, if php reaches line 44 (which is not happening since it stops at line 38), I guess it would raise a similar error: $q = "SELECT FROM COLUMNS WHERE TABLE_NAME = '".$table."' AND TABLE_SCHEMA = '".$db."'";
Again, there is not a table called "COLUMNS" in my schema
What am I doing wrong?
Not sure if this is related, but what database should I define in setup_import() ? I had defined "DB"="myDB", and now I changed it to the initial value of "information_schema", and I get no errors but import is still not working. There is not an "information_schema" on my server. I use MySQL 4.1.22, perhaps this is the problem? If so, I think this is important to mention.
Anyway, could you please tell me if this is the right code in my example? (bold text):
I tried a MySQL 5.1.37 server, and it works!
Perhaps I should have figured this out, but is something easy to document in the installation manual (minimum requirements)
I still think you should somehow document the bold parts of my previous message: I had not clear if I had to change the default DB in setup_import(), as I didn't know that "information_schema" was the name used in MySQL 5 to store that info.
I also think it is important to see cardinality in ER diagram, and distinguish 1-1, 1-many, many-many relationships
Great work!
A couple of things I found, related to comments in MySQL fields, which are not well processed when saving XML ER-diagrams (I tried to add an issue but for some reason it dissapeared):
- If you use non-english characters inside a field comment, they got corrupted when you save the XML (i.e., "ñ" of "España" got changed to "España"). There are MANY of these errors when the designer does not use English language. Perhaps this is something related to character encoding of wwwsqldesigner and is possible to modify. Any hints?
- If you add some html tags inside a comment (I use this for adding a link to a better description of the field), the XML will be invalid. This is obvious but perhaps it is possible to escape "<" and ">" somehow?
Many thanks in advance
Hi there! Thank you for the great tool! But I just can't understand how to load a saved php-file scheme...
I have set up the program to work when accesing http://sqldesigner.yy/. When accessing http://sqldesigner.yy/backend/php-file/data/?keyword=rff the desired rff is not loaded, although I see the file in the directory. Could you please tell what am I doing wrong?
First, test that your backend works: /backend/php-file/?action=load&keyword=rff
Second, try loading that saved design via WWWSQLDesigner's interface: using "Load" button in "Save / Load" dialog
Third, to use auto-load, just open /?keyword=rff (provided you have php-file as a default backend)
ondrej.zara, thank you for you answer! I have passed the first two steps but I can't figure out how to set the php-file as my default backend. I can't find such an option in the options dialog.
This cannot be set via Options, it is configured in config.js file.
thank you! everything works perfectly now!
This is a GREAT tool! I tried many many tools and never found a simple yet wonderful tool such as this. Zara, all praises to you. Keep up the good work.
Tool is great, however I have a little problem with my current DB-Design, which requires composite foreign keys, which I can't set up here. Usually a foreign-key-constraint should link to a primary key of another table, so if the primary key is composite, the foreign key constraint should/could be the same. This is for oracle DB design.
Any chance foreign keys are displayed with a direction so one sees at once what is a primary key and what is a foreign key?
Many thanks for the good work.
It looks like you are interested in issue #60: http://code.google.com/p/wwwsqldesigner/issues/detail?id=60
Dear Ondrej,
yes, issue #60 is one part - especially if one has a FK-constraint between two PKs and things like that.
However, if I have a composite PK, the FK-constraint should also reflect this. That is, if I have PRIMARY KEY ('U_ID','SUBCLASS') for table A, then I'd need ALTER TABLE B ADD FOREIGN KEY ('X_ID','S_CLASS') REFERENCES A (U_ID,'SUBCLASS').
I also noted that if I have two foreign keys on one field, then selecting foreign key? will delete all foreign keys for that field...
Is this specific to Oracle? I hope I might be able to address this issue in the relevant XSL template, but I need to know which database engines support this syntax... please file this as a new item in the issue tracker (http://code.google.com/p/wwwsqldesigner/issues/list).
Dear Ondrej,
this is not specific to Oracle, as most modern databases support both column and table constrains, multi_colum primary keys and multi_column foreign keys (as table constraint).
I have entered this as issue #110. Sorry it is not set as enhancement request. Hope the links for explanations are ok. Have not checked all databases - only those I am more familiar with :-)
An absolutely incredible tool! I wish there was something I could offer in return - oh wait there is! Do you have a paypal account? :)
if you do email me on ben AT? doglegdesign DOT? co DOT? uk and I will donate as I feel I will be using your application a lot.
The Paypal icon is located directly on the homepage at http://code.google.com/p/wwwsqldesigner/ :)
Excellent - will make a donation on monday :) One question - import from DB gives me a "service unavailable" every time i try it, is there something i am missing? do I have to set any additional user/pwd combos in the PHP code?
Nice application! I start to use it yesterday, I didn't find any bugs.. I will let you know I find one. Thanks a lot!
In order to import from a DB, you must configure your DB credentials in the relevant backend/my-db-name/index.php file.
Thanks, ondrej, for this soft. But i don't understand what about in "options"->"Database for new designs". One option is web2py. What that mean, the program can read/save as db.py file?. I'm interesting in working with your software for design in web2py. Thanks.
"Database for new designs" is merely a specification of available datatypes and the XSL template used to generate SQL. For instance, "web2py" datatypes and xslt can be checked at http://code.google.com/p/wwwsqldesigner/source/browse/#svn/trunk/db/web2py .
Thanks, ondrej, but why you rename "dbObject" in the XSL template to the database connection in web2py, if the standard is "db"?.
And, the only way to save something in this soft is via php-mysql? Thanks, ondrej.
1) I have no idea how web2py XSLT template works, it is a contributed code. Commited in r52, submitted by Boris Manojlovic.
2) The online demo version (hosted by myself) has only the "php-mysql" backend enabled, for security reasons. Feel free to download wwwsqldesigner, as it contains support for many more storage backends.
WWWSqlDesigner 2.5 on Windows XP SP3 using Firefox 3.6.12, Chrome 7.0.517.44, Safari 5.0.2 (7533.18.5) on that same machine connecting via Apache and using Firefox 3.6.12 on a Linux Mint 9.01 box.
If Options->"Hide connections on table drag" is true (i.e., checked) and I then drag a table with a connection, the line is not redrawn when I release the table (with shift-left_click).
Internet Explorer 8.0.6001.18702 on that same machine the following error messages are received; the second one is from the debugging window:
Message: Object doesn't support this property or method Line: 926 Char: 29 Code: 0 URI: http://localhost/wwwsqldesigner/js/wwwsqldesigner.js
SQL.Table.prototype.up = function(e) {
}The "if" line is the one it's complaining about.
All of these work correctly (to the extent that I tested them) if "Hide connections..." is false.
Just as a comment: If a table has no connections to it, then when I drag it, it can be dropped by just releasing the mouse button. If it has connections, then I must shift-left_click to drop it. It would be nice if it was consistent.
Oops... sorry... I didn't make sure that there would be line breaks in the JS debugging output when I pasted it in. There should be a newline after each ';'.
The problem you described was just fixed, in revision 114.
Velmi kvalitní nástroj! Díky. Konečně něco, co není přeplácané rádoby užitečným flashem či silverlightem (který mi na Ubuntu jede docela problematicky), ale něco, co je jednoduché, intuitivní a zcela dostačující. Fakt paráda :-)
Eda
Great tool. We have installed and are evaluating internally. Although we only have a couple hours under our belt we are very impressed with performance and usability.
Question: Is there a legend that explains the colors of lines, tables, fields?
Thanks Sean
Field colors are DB-specific; they are defined in the corresponding datatypes.xml file. Line colors are almost random; they are picked from a pool of RELATION_COLORS in config.js.
Thanks for the reply. this helps understand the table/field colors. Thanks again for a great product. we will continue to test with our engineers.
Hi,
wow this is the best browser application for developers! Great tool!
The size of INTEGER fields are missing when I export the MySQL tables. Expample:
INT(11) instead of INT(1)
thx const
Are the size numbers still missing on the demo installation, http://ondras.zarovi.cz/sql/demo/ ?
It works online:
{{{CREATE TABLE test (
);}}}On my local ubuntu server and client with goggle chrome i get:
{{{CREATE TABLE test (
);Then please use the latest SVN trunk revision, instead of the (older) 2.5 release :)
amazing tools generator, small size,easy use, i has make simple table and i generate to mysql is work when i copy paste to my phpmyadmin, thanks a lot of
Good tool Ondrej.Except that we were slightly unclear on to save the generated script to direct Sql script file if you could give us direction on that part we will be grateful.
Waiting more support for sqlite. Would be great.
Generated SQL script cannot be automatically saved to a hard drive; you must copy&paste the SQL statements generated by WWW SQL Designer.
Or was your question regarding something different?
Eric, what kind of more SQLite support do you require?
It is perhaps worth noting that special permissions are required to access information_schema, tables, columns etc that are often not part of default permissions that say a basic hosting provider would give you on a mysql database. if you have simply created a database and login credentials for it (I create mine through plesk) there will be no access to these other system tables for example and import will not work. A user needs to be added with permissions to read these tables and also the database you are looking at. I had to dig around in the code to work this out before it would work. I can see a few people do not know this, not everyone has access to their mysql server to do this either - shared hosting accounts for example.
As I mentioned in another post, I also rewrote the import on my version to read table descriptions rather than the information_schema etc. This would remove this user credentials issue for basic users. It also vastly speeds up the import process to a few seconds rather than a few minutes. The code I have is customised to a particular and somewhat peculiar database setup (I am using MyISAM tables which don't support foreign keys, and storing the table relations in another db table which is being read to generate the links) perhaps I will post this anyway when I have tidied it up.
The front end as I said before is quite simply a stunning piece of work!
I had a problem to load because of set_time_limit function. I just comment line 2 in backend\php-mysql\index.php to let the webserver default value and it works fine if that can help anybody ;)
Hi
Great tool, a bit poor on the manual side tough !!
I've poor knowledge of PHP and MySQL
The web site seems to work, I can add table, fields etc. But cannot load/save, no errors tough...
any step by step to check?
Kjell
What is your environment? What version of OS, Apache, PHP, MySQL do you use? In order to save DB designs, you must correctly configure one of the available backends. I presume you want to ge the "php-mysql" backend working, which stores designs in MySQL accessed by server-side PHP?
my small "Getting Started" in Spanish http://elcaminillo.wordpress.com/2011/10/28/disenando-bases-de-datos-con-sqldesigner/
Superb! I Love this.
Amazing tool :)
How do i start the program?
It is not a program; it is a web page. Navigate your browser to the location where WWW SQL Designer is installed: either my public demo installation at http://ondras.zarovi.cz/sql/demo/ or your own webserver, if you downloaded the archive.
I can save my schemes to a data file on the server backend and load using the load feature however appending ?keyword=default or other key words that correspond to the files on the server yield only a blank canvas. Also, when attempting to import from DB I get similar behavior. I click on Import From DB, provide the database name and then a blank canvas loads. I get this error in my error log: [29-Jan-2012 19:55:10] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /path/backend/php-mysql+file/mysql_import.php on line 16 I was keen on following the instructions and I know my DB credentials are correct. Thanks
Can you run this query against your database? What are the results?
SELECT FROM TABLES WHERE TABLE_SCHEMA = 'name_of_my_db';
Using phpMyAdmin to run the query it tells me that I have a syntax error. Running the query with mysql_query() it returns nothing. I am using a shared host running PHP Version 5.2.17, MySQL Client API version 5.1.59 Server version: 5.1.60-community-log Thanks
Are you executing this query against the "information_schema" database? You MUST use information_schema, not your actual database.
Yes using information_schema
Update i change the query in phpMyADMIN to look like this: SELECT FROM TABLES WHERE TABLE_SCHEMA = 'name_of_DB' LIMIT 0 , 30 and it showed me the list of tables in the DB. It seems it wants the backticks. So, I added the backticks on the query in index.php and loading from database now works. Calling up the design file with ?keyword=my_design_file at the end of the URL does not work. It does call up the design when I use the Load button on the app. I assume this GET variable is passed to one of the php scripts which picks up the design. Is it pulling from the file system or the DB? wwwsqldesigner has no rows after a save of a design. Thanks
Doesn't work on latest version of MAC Chrome. The tool does not display...
Works in Chrome 17 / Mac OSX. Have you tried http://ondras.zarovi.cz/sql/demo/?keyword=default ?
I'm wondering why they are only these number types : INTEGER DECIMAL SINGLE PRECISION DOUBLE PRECISION
What about all the other number types ? How could I make a SMALLINT for instance ? http://www.w3schools.com/sql/sql_datatypes.asp
Does it has something to do with the fact than only types common to all DBMS are references in sqldesigner ?
Hi,
individual data types are "plugins" into wwwsqldesigner; if you are not happy with the offered types, feel free to add them manually. Just browse to "db/" subdirectory, pick a DB of your preference and edit its "datatypes.xml" file.
Thanks @ondrej.zara Exaclty what I was looking for.
how I can use this code for www.ysapak.com ? can you reply me?
i can't see anything like toolbar in my Chrome(recently ver). how i can find this toolbar. -0-; this is my first error on using this sqldesigner.
Does this happen at http://ondras.zarovi.cz/sql/demo/?keyword=default as well?
I am not able to save created tables in database. And please help me to import and export data into database by supporting referential integrity.
To create tables, export your design to SQL script and run it against your database.
This is a fantastic tool - very elegant, intuitive and USEFUL! The only issue is I have is with the output from "Generate SQL" in "Save/Load". I get syntax errors when trying to run the generated SQL through phpMySQL - it doesn't like the use of NULL etc, somehow; It was still easy enough to do a search and replace in the text file I created to fix the problem. Also - here's a feature request: it would be nice if the tool enabled you to create 'soft' relationships (eg, with dotted lines etc) to indicate key relationships without formal, foreign-key restraints... THANK YOU for this wonderful piece of code - please keep up the good work!