diff --git a/scripts/generate_db_helpers.go b/scripts/generate_db_helpers.go
index 547b573df49e906a16805dd94468ea5db5084c84_c2NyaXB0cy9nZW5lcmF0ZV9kYl9oZWxwZXJzLmdv..6634e1f0eaacd1a2e8682e30603a433583c6b27b_c2NyaXB0cy9nZW5lcmF0ZV9kYl9oZWxwZXJzLmdv 100644
--- a/scripts/generate_db_helpers.go
+++ b/scripts/generate_db_helpers.go
@@ -96,6 +96,9 @@
 	for _, p := range packages {
 		pkg = p
 	}
+	if pkg == nil {
+		log.Fatal("pkg cannot be nil here...")
+	}
 
 	topLevel := Package{Name: pkg.Name, AllStructs: make(map[string]*ast.StructType)}
 
@@ -506,6 +509,22 @@
 	return {{.Name}}DataColumns
 }
 
+// FQColumns returns the database table column names prefixed with the table alias
+func (t {{.Name}}TableSchema) FQColumns(withPKey bool) []string {
+	var colList []string
+    colList = {{.Name}}DataColumns
+
+	if withPKey {
+		colList = {{.Name}}Columns	
+	}
+
+    var cols []string
+	for _, col := range colList {
+			cols = append(cols, t.GetName()+"."+col)
+	}
+	return cols
+}
+
 func (t {{.Name}}TableSchema) As(name string) *{{.Name}}TableSchema {
 	t.alias = name
 {{- range .Fields}}