shared/generate/db/stmt.go
func (s *Stmt) Generate(buf *file.Buffer) error {
	if strings.HasPrefix(s.kind, "objects") {
		return s.objects(buf)
	}

	if strings.HasPrefix(s.kind, "create") && strings.HasSuffix(s.kind, "-ref") {
		return s.createRef(buf)
	}

	if strings.HasSuffix(s.kind, "-ref") || strings.Contains(s.kind, "-ref-by-") {
		return s.ref(buf)
	}

	if strings.HasPrefix(s.kind, "names") {
		return s.names(buf)
	}

	switch s.kind {
	case "create":
		return s.create(buf)
	case "id":
		return s.id(buf)
	case "rename":
		return s.rename(buf)
	case "update":
		return s.update(buf)
	case "delete":
		return s.delete(buf)
	default:
		return fmt.Errorf("Unknown statement '%s'", s.kind)
	}
}
func (s *Stmt) Generate(buf *file.Buffer) error {
	if strings.HasPrefix(s.kind, "objects") {
		return s.objects(buf)
	}

	if strings.HasPrefix(s.kind, "create") && strings.HasSuffix(s.kind, "-ref") {
		return s.createRef(buf)
	}

	if strings.HasSuffix(s.kind, "-ref") || strings.Contains(s.kind, "-ref-by-") {
		return s.ref(buf)
	}

	if strings.HasPrefix(s.kind, "names") {
		return s.names(buf)
	}

	switch s.kind {
	case "create":
		return s.create(buf)
	case "id":
		return s.id(buf)
	case "rename":
		return s.rename(buf)
	case "update":
		return s.update(buf)
	case "delete":
		return s.delete(buf)
	default:
		return fmt.Errorf("Unknown statement '%s'", s.kind)
	}
}
func ( s * Stmt ) Generate ( buf * file . Buffer ) error { if strings . HasPrefix ( s . kind , " " ) { return s . objects ( buf ) } if strings . HasPrefix ( s . kind , " " ) && strings . HasSuffix ( s . kind , " " ) { return s . createRef ( buf ) } if strings . HasSuffix ( s . kind , " " ) || strings . Contains ( s . kind , " " ) { return s . ref ( buf ) } if strings . HasPrefix ( s . kind , " " ) { return s . names ( buf ) } switch s . kind { case " " : return s . create ( buf ) case " " : return s . id ( buf ) case " " : return s . rename ( buf ) case " " : return s . update ( buf ) case " " : return s . delete ( buf ) default : return fmt . Errorf ( " " , s . kind ) } }
// Generate plumbing and wiring code for the desired statement.
Generate plumbing and wiring code for the desired statement .