## GdaDbBase GdaDbBase — The basic class for all database objects |

## Stability Level

Stable, unless otherwise indicated

## Functions

gint | gda_db_base_compare ()
const gchar * | gda_db_base_get_catalog ()
const gchar * | gda_db_base_get_full_name ()
const gchar * | gda_db_base_get_name ()
const gchar * | gda_db_base_get_schema ()
GdaDbBase * | gda_db_base_new ()
void | gda_db_base_set_catalog ()
void | gda_db_base_set_name ()
void | gda_db_base_set_names ()
void | gda_db_base_set_schema ()

## Types and Values

| GdaDbBase
#define | GDA_TYPE_DB_BASE

## Object Hierarchy

        GObject
        ╰── GdaDbBase
            ├── GdaDbIndex
            ├── GdaDbTable
            ╰── GdaDbView

## Includes

    #include <libgda/libgda.h>

## Description

This is a basic class for database objects, e.g. GdaDbTable and GdaDbView. It is not common to use it directly.

## Functions

### gda_db_base_compare ()

    gint
    gda_db_base_compare (GdaDbBase *a,
                         GdaDbBase *b);

Compares two objects similar to `g_strcmp()`. In general, catalog and schema can be `NULL`. In this case those pairs are ignored. If we represent a full name as catalog.schema.name then two objects null.null.customer and main.main.customer are identical.

#### Parameters

a | first GdaDbBase object |
b | second GdaDbBase object |

#### Returns

0 if two objects are identical or -1 or 1 otherwise.

Since: 6.0

### gda_db_base_get_catalog ()

    const gchar *
    gda_db_base_get_catalog (GdaDbBase *self);

Returns current catalog name. The returned string should not be freed.

#### Parameters

self | a GdaDbBase object |

#### Returns

Current catalog or `NULL`

Since: 6.0

### gda_db_base_get_full_name ()

    const gchar *
    gda_db_base_get_full_name (GdaDbBase *self);

This method returns a full name in the format catalog.schema.name. If schema is `NULL` but catalog and name are not, then only name is returned. If catalog is `NULL` then full name will be in the format: schema.name. If all three components are not set, then `NULL` is returned.

#### Parameters

self | an instance of GdaDbBase |

#### Returns

Full name of the database object or `NULL`.

Since: 6.0

### gda_db_base_get_name ()

    const gchar *
    gda_db_base_get_name (GdaDbBase *self);

Returns current object name. The returned string should not be freed.

#### Parameters

self | GdaDbBase object |

#### Returns

Current object name or `NULL`

Since: 6.0

### gda_db_base_get_schema ()

    const gchar *
    gda_db_base_get_schema (GdaDbBase *self);

Returns current schema name. The returned string should not be freed.

#### Parameters

self | GdaDbBase object |

#### Returns

Current scheme or `NULL`

Since: 6.0

### gda_db_base_new ()

    GdaDbBase *
    gda_db_base_new (void);

Create a new GdaDbBase instance

#### Returns

a new GdaDbBase instance

### gda_db_base_set_catalog ()

    void
    gda_db_base_set_catalog (GdaDbBase *self,
                             const gchar *catalog);

Set catalog name

#### Parameters

self | a GdaDbBase instance |
catalog | Catalog name as a string |

Since: 6.0

### gda_db_base_set_name ()

    void
    gda_db_base_set_name (GdaDbBase *self,
                          const gchar *name);

Set object name. If `name` is `NULL` the function just returns.

#### Parameters

self | a GdaDbBase instance |
name | Object name as a string |

Since: 6.0

### gda_db_base_set_names ()

    void
    gda_db_base_set_names (GdaDbBase *self,
                           const gchar *catalog,
                           const gchar *schema,
                           const gchar *name);

Sets database object names. `catalog` and `schema` can be `NULL` but `name` always should be a valid, not `NULL` string. The `name` must be set. If `catalog` is `NULL` `schema` may not be `NULL` but if `schema` is `NULL` `catalog` also should be `NULL`.

#### Parameters

self | a GdaDbBase object |
catalog | a catalog name associated with the table. | [nullable]
schema | a schema name associated with the table. | [nullable]
name | a table name associated with the table |

Since: 6.0

### gda_db_base_set_schema ()

    void
    gda_db_base_set_schema (GdaDbBase *self,
                            const gchar *schema);

Set object schema. If `schema` is `NULL` the function just returns.

#### Parameters

self | a GdaDbBase instance |
schema | Schema name as a string |

Since: 6.0

## Types and Values

### GdaDbBase

    typedef struct _GdaDbBase GdaDbBase;

### GDA_TYPE_DB_BASE

    #define GDA_TYPE_DB_BASE (gda_db_base_get_type())

## See Also

GdaDbTable, GdaDbView