“Show me your flowcharts (source code), and conceal your tables (domain model), and I shall continue to be mystified; show me your tables (domain model) and I won’t usually need your flowcharts (source code): they’ll be obvious.”
~ Fred Brooks, “The Mythical Man Month”
Once you get into serious Drupal module development, you'll realize that it would be really helpful if you could do several things during the module development process, including clearing the cache, rebuilding the menus, error logging (logging errors to a file, in particular), and so on. Fortunately, with Drupal's really large developer ecosystem, other Drupal programmers have already created some great modules to help you along in the coding process.
Here's a list of the Drupal developer modules I currently use, or have used.
SQLite foreign keys FAQ: Can you show me how to define foreign keys in a SQLite database table design?
The SQLite database does support foreign keys, and its foreign key syntax is similar to other databases. Here’s a quick SQLite foreign key example.
SQLite schema FAQ: How do I list the schema for SQLite database table?
To view the schema for a SQLite database table, just use the SQLite
schema command, like this:
MySQL database FAQ: Can you provide a large, complete, example MySQL database design?
I recently worked on a project where I wrote a web-based user interface that would let "everyday users" maintain their own Nagios configuration data. After logging in to the web interface, users could modify the Nagios configuration as desired, for instance, when they added new equipment to their network.
I may have shown this before in other ways, but I wanted to take a moment to show how to use a MySQL database from the MySQL command line client. The basic command to work with an existing database is the
use command, where you say something like this:
mysql> use my_database
For instance, if you have a database named
orders, you would declare that you want to start working with it (use it) like this:
MySQL FAQ: How do I show the schema of a MySQL database table?
Answer: Use the
desc command from the MySQL command line client.
For instance, in my current application I have a database table named
orders, and when I need to see the schema for that table I show it with the
desc command like this:
The MySQL output looks like this:
MySQL table/schema FAQ: How do I show a database table schema in a MySQL database?
Short answer: To show the schema for a MySQL database table, use the MySQL
desc command. You issue this command from the MySQL client command line prompt, like this:
MySQL backup FAQ - How do I backup/dump a MySQL database schema?
Answer: Use the mysqldump database utility.
MySQL dump examples using the mysqldump utility
On a DOS/Windows pc with no name/password protection, you can dump a database named
my_db with the following command, but don't do this just yet:
Note that this gets you not only the database schema, but also the current data in the table.