code: func gen(dbms, connStr string, mode byte, selectedTableNames map[string]bool, apppath string) {
  	db, err := sql.Open(dbms, connStr)
  	if err != nil {
  		beeLogger.Log.Fatalf("Could not connect to '%s' database using '%s': %s", dbms, connStr, err)
  	}
  	defer db.Close()
  	if trans, ok := dbDriver[dbms]; ok {
  		beeLogger.Log.Info("Analyzing database tables...")
  		var tableNames []string
  		if len(selectedTableNames) != 0 {
  			for tableName := range selectedTableNames {
  				tableNames = append(tableNames, tableName)
  			}
  		} else {
  			tableNames = trans.GetTableNames(db)
  		}
  		tables := getTableObjects(tableNames, db, trans)
  		mvcPath := new(MvcPath)
  		mvcPath.ModelPath = path.Join(apppath, "models")
  		mvcPath.ControllerPath = path.Join(apppath, "controllers")
  		mvcPath.RouterPath = path.Join(apppath, "routers")
  		createPaths(mode, mvcPath)
  		pkgPath := getPackagePath(apppath)
  		writeSourceFiles(pkgPath, tables, mode, mvcPath)
  	} else {
  		beeLogger.Log.Fatalf("Generating app code from '%s' database is not supported yet.", dbms)
  	}
  }
docs: // Generate takes table, column and foreign key information from database connection
  // and generate corresponding golang source files