GdaDdlBase

GdaDdlBase — The basic class for all database objects

Stability Level

Stable, unless otherwise indicated

Types and Values

Object Hierarchy

    GObject
    ╰── GdaDdlBase
        ├── GdaDdlTable
        ╰── GdaDdlView

Includes

#include <libgda/libgda.h>

Description

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

Functions

gda_ddl_base_new ()

GdaDdlBase *
gda_ddl_base_new (void);

Create a new GdaDdlBase instance

Returns

a new GdaDdlBase instance


gda_ddl_base_set_names ()

void
gda_ddl_base_set_names (GdaDdlBase *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 always set. If catalog is NULL schema may not be NULL but if schema is NULL catalog also should be NULL.

Parameters

self

a GdaDdlBase object

 

catalog

a catalog name associated with the table

 

schema

a schema name associated with the table

 

name

a table name associated with the table

 

Since: 6.0


gda_ddl_base_get_full_name ()

const gchar *
gda_ddl_base_get_full_name (GdaDdlBase *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 GdaDdlBase

 

Returns

Full name of the database object or NULL.

Since: 6.0


gda_ddl_base_get_name ()

const gchar *
gda_ddl_base_get_name (GdaDdlBase *self);

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

Parameters

self

GdaDdlBase object

 

Returns

Current object name or NULL

Since: 6.0


gda_ddl_base_set_name ()

void
gda_ddl_base_set_name (GdaDdlBase *self,
                       const gchar *name);

Set object name

Parameters

self

a GdaDdlBase instance

 

name

Object name as a string

 

Since: 6.0


gda_ddl_base_get_catalog ()

const gchar *
gda_ddl_base_get_catalog (GdaDdlBase *self);

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

Parameters

self

a GdaDdlBase object

 

Returns

Current catalog or NULL

Since: 6.0


gda_ddl_base_set_catalog ()

void
gda_ddl_base_set_catalog (GdaDdlBase *self,
                          const gchar *catalog);

Set catalog name

Parameters

self

a GdaDdlBase instance

 

catalog

Catalog name as a string

 

Since: 6.0


gda_ddl_base_get_schema ()

const gchar *
gda_ddl_base_get_schema (GdaDdlBase *self);

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

Parameters

self

GdaDdlBase object

 

Returns

Current catalog or NULL

Since: 6.0


gda_ddl_base_set_schema ()

void
gda_ddl_base_set_schema (GdaDdlBase *self,
                         const gchar *schema);

Set object schema.

Parameters

self

a GdaDdlBase instance

 

schema

Schema name as a string

 

Since: 6.0


gda_ddl_base_free ()

void
gda_ddl_base_free (GdaDdlBase *self);

A convenient method to free the memory. It is a wrapper around g_clear_object().

Parameters

self

a GdaDdlBase instance to free.

 

Since: 6.0


gda_ddl_base_compare ()

gint
gda_ddl_base_compare (GdaDdlBase *a,
                      GdaDdlBase *b);

Compares two objects similar to g_strcmp().

Parameters

a

first GdaDdlBase object

 

b

second GdaDdlBase object

 

Returns

0 if catalog, schema and name are the same

Since: 6.0


GDA_BOOL_TO_STR()

#define GDA_BOOL_TO_STR(x) (x ? "TRUE" : "FALSE")

Types and Values

GDA_TYPE_DDL_BASE

#define GDA_TYPE_DDL_BASE (gda_ddl_base_get_type())

struct GdaDdlBaseClass

struct GdaDdlBaseClass {
  GObjectClass parent;
};

GdaDdlBase

typedef struct _GdaDdlBase GdaDdlBase;