February 2020
Intermediate to advanced
404 pages
8h 42m
English
Let's write a few SQL strings for creating the tables for the preceding train, station, and route resources. We are going to create a project layout for this API. Create two directories called railAPI and dbutils in $GOPATH/src/github.com/git-user/chapter4.
Here, railAPI is our project source, and dbutils is our own package for handling database initialization utility functions. Follow these steps:
package dbutilsconst train = ` CREATE TABLE IF NOT EXISTS train ( ID INTEGER PRIMARY KEY AUTOINCREMENT, DRIVER_NAME VARCHAR(64) NULL, OPERATING_STATUS BOOLEAN )`const station = ` CREATE TABLE IF NOT ...
Read now
Unlock full access