Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • L libgda
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 67
    • Issues 67
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • libgda
  • Issues
  • #223
Closed
Open
Issue created Jul 28, 2020 by Danilo Galete@galetedanilo💬Contributor

GdaDbTable new functionality.

It is possible, for example, to have a new function gda_db_table_get_table ("table name"), which returns a GdaDbTable, and a function gda_db_column_get_column ("table name", "column name"), which returns a GdaDbColumn. This way we can make use of a very easy code.

GdaDbTable *table = gda_db_table_get_table (cnc, "TableUsers");

gda_db_base_set_name (GDA_DB_BASE (table), "NewName");

if (!gda_ddl_modifiable_rename (GDA_DDL_MODIFIABLE (table), cnc, table, NULL))
{
   g_error ("Error");
}

GdaDbColumn *column = gdb_db_column_get_column (table, "ColumnName");
gda_db_column_set_name (column, "LastName");

g_object_set (column, "table", table, NULL);

if (!gda_ddl_modifiable_create (GDA_DDL_MODIFIABLE (column), cnc, NULL, NULL))
    g_error ("Error");

A very simple and easy way to change a table or column.

Edited Jul 29, 2020 by Danilo Galete
Assignee
Assign to
Time tracking