Database reflection

I’m new to golang, and I need to evaluate the db scheme , to perform operations in the scheme. but I’m a little lost. anyone has any advice or know any library that can help me.

I assume you mean “schema” rather than “scheme”. It would help if you specified what database you’re using; the standard place to look is the INFORMATION_SCHEMA schema, e.g. SELECT * FROM INFORMATION_SCHEMA.TABLES to get a list of tables. but different databases may have different locations. For example, on DB2 it’s SYSCAT.TABLES rather than INFORMATION_SCHEMA.TABLES.

@sheng i use gorm, but @mathew you are right, i need use the scheme queries, thanks for your help

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.