concept database in category go

appears as: database, databases, database, databases
Go Web Programming

This is an excerpt from Manning's book Go Web Programming.

Although originally developed for the desktop, it became popular for writing web applications, and many web application frameworks—including Ruby on Rails, CodeIgniter, Play, and Spring MVC—use it as their foundation pattern. The model is often mapped to a database using structures or objects, the views are the returned HTML, and the controllers route the requests and manage access to the models.

Figure 2.8. Connecting the struct model with the database and the handler
  • In a database, fronted by a server program
  • Once you’ve created the database, you’ll follow these steps:

    This command creates a Postgres database user called gwp. The option -P tells the createuser program to prompt you for a password for gwp, and the option -d tells the program to allow gwp to create databases. You’ll be prompted to enter gwp’s password, which I assume you’ll set to gwp as well.

    Next, you’ll create the database for the gwp user. The database name has to be the same as the user’s name. You can create databases with other names but that will require setting up permissions and so on. For simplicity’s sake let’s use the default database for our database user. To create a database named gwp, run this command at the console:

    createdb gwp

    Now that you have a database, let’s create our one and only table. Create a file named setup.sql with the script shown in this listing.

    sitemap

    Unable to load book!

    The book could not be loaded.

    (try again in a couple of minutes)

    manning.com homepage
    test yourself with a liveTest