| Top |
| #define | GDA_TYPE_DDL_COLUMN |
| struct | GdaDdlColumnClass |
| enum | GdaDdlColumnError |
| #define | GDA_DDL_COLUMN_ERROR |
| GdaDdlColumn |
This object represents a column of a table or a view. The column can be constracted manually using API or generated from xml file together with other databse objects. See GdaDdlCreator. GdaDdlColumn implements GdaDdlBuildable interface for parsing xml file.
GdaDdlColumn *
gda_ddl_column_new_from_meta (GdaMetaTableColumn *column);
Create new GdaDdlColumn instance from the corresponding GdaMetaTableColumn
object. If NULL is passed this function works exactly as
gda_ddl_column_new()
void
gda_ddl_column_free (GdaDdlColumn *self);
Convenient function to free the object
Since: 6.0
const gchar *
gda_ddl_column_get_name (GdaDdlColumn *self);
Returns name of the column
Since: 6.0
void gda_ddl_column_set_name (GdaDdlColumn *self,const gchar *name);
Set column name.
Since: 6.0
GType
gda_ddl_column_get_gtype (GdaDdlColumn *self);
Return of column type as GType
Since: 6.0
const gchar *
gda_ddl_column_get_ctype (GdaDdlColumn *self);
Returns column type as a string derivied from GType
Since: 6.0
void gda_ddl_column_set_type (GdaDdlColumn *self,GType type);
Set type of the column as a GType
Since: 6.0
guint
gda_ddl_column_get_scale (GdaDdlColumn *self);
Scale is used for float number representation to specify a number of decimal digits. This value is ignore for column types except float or double.
Since: 6.0
void gda_ddl_column_set_scale (GdaDdlColumn *self,guint scale);
Scale is used for float number representation to specify a number of decimal digits. This value is ignore for column types except float or double.
Since: 6.0
gboolean
gda_ddl_column_get_pkey (GdaDdlColumn *self);
Returns a primary key flag
Since: 6.0
void gda_ddl_column_set_pkey (GdaDdlColumn *self,gboolean pkey);
Since: 6.0
gboolean
gda_ddl_column_get_nnul (GdaDdlColumn *self);
Specify if the column's value can be NULL.
Since: 6.0
void gda_ddl_column_set_nnul (GdaDdlColumn *self,gboolean nnul);
Since: 6.0
gboolean
gda_ddl_column_get_autoinc (GdaDdlColumn *self);
Get value for autoinc key
Since: 6.0
void gda_ddl_column_set_autoinc (GdaDdlColumn *self,gboolean autoinc);
Set value for auto-incremented key.
Since: 6.0
gboolean
gda_ddl_column_get_unique (GdaDdlColumn *self);
Get value for unique key
Since: 6.0
void gda_ddl_column_set_unique (GdaDdlColumn *self,gboolean unique);
Set value for unique key.
Since: 6.0
const gchar *
gda_ddl_column_get_comment (GdaDdlColumn *self);
Get value for column comment.
Since: 6.0
void gda_ddl_column_set_comment (GdaDdlColumn *self,const gchar *comnt);
Set value for column comment.
Since: 6.0
void gda_ddl_column_set_size (GdaDdlColumn *self,guint size);
Set value for column size. This is relevant only for string column type.
Since: 6.0
const gchar *
gda_ddl_column_get_default (GdaDdlColumn *self);
Returns default value for the column. Can be NULL if the default value hasn't been set.
Since: 6.0
void gda_ddl_column_set_default (GdaDdlColumn *self,const gchar *value);
Since: 6.0
const gchar *
gda_ddl_column_get_check (GdaDdlColumn *self);
Returns value of the check field.
Since: 6.0
void gda_ddl_column_set_check (GdaDdlColumn *self,const gchar *value);
Sets check string to the column.
Since: 6.0
gboolean gda_ddl_column_prepare_create (GdaDdlColumn *self,GdaServerOperation *op,guint order,GError **error);
This method populate op
with information stored in self
.
self |
a GdaDdlColumn instance |
|
op |
a GdaServerOperation instance to update for TABLE_CREATE operation |
|
error |
a GError container |
Since: 6.0
gboolean gda_ddl_column_prepare_add (GdaDdlColumn *self,GdaServerOperation *op,GError **error);
Populate op
with information stored in self
. This method is used to
prepare op
for GDA_SERVER_OPERATION_ADD_COLUMN operation.
self |
a GdaDdlColumn instance |
|
op |
GdaServerOperation to add information |
|
error |
error storage container |
“autoinc” property“autoinc” gboolean
Can value be autoincremented.
Flags: Read / Write
Default value: FALSE
“scale” property“scale” guint
Number of decimal for numeric type.
Flags: Read / Write
Allowed values: <= 64
Default value: 2
“size” property“size” guint
Column size.
Flags: Read / Write
Allowed values: <= 9999
Default value: 80
“unique” property“unique” gboolean
Can value be unique.
Flags: Read / Write
Default value: FALSE