Closed robdeacon closed 10 months ago
To change target database name, you can use global UseSchema
method. For instance:
import "path/to/generated/table"
func main() { // or init
table.UseSchema("prod_db")
}
To change target database name, you can use global
UseSchema
method. For instance:import "path/to/generated/table" func main() { // or init table.UseSchema("prod_db") }
Thank you for this. I must have missed this if that was in the examples.
Describe the bug When deploying binary to a Linux server the log gives - jet: Error 1146 (42S02): Table '.' doesn't exist)
Environment (please complete the following information):
Code snippet
Expected behaviour Generated go-jet folders and files without issue on Dev machine (Windows) runs no problem. When i deploy a compiled Linux binary i get the following error in the logs. "getNextTasks2 Query error jet: Error 1146 (42S02): Table 'mydevdb.tblgo_task' doesn't exist) "
The mydevdb is the database used on the Dev machine. Looks like go-jet doesn't support deployed binaries using different named databases? Or I cannot see how that would work as the generated files all have the Dev mydevdb. I can't use the same database name as i need to deploy this to different named databases in the same target environment. If there is a way please let me know.
For debugging i did add an empty db called mydevdb to my target so I can understand better, hence the above.