GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
c_create_idx.c File Reference

DBMI Library (client) - create index. More...

#include <string.h>
#include <grass/dbmi.h>
#include "macros.h"
Include dependency graph for c_create_idx.c:

Go to the source code of this file.

Functions

int db_create_index (dbDriver *driver, dbIndex *index)
 Create index. More...
 
int db_create_index2 (dbDriver *driver, const char *table_name, const char *column_name)
 Create unique index. More...
 

Detailed Description

DBMI Library (client) - create index.

(C) 1999-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Joel Jones (CERL/UIUC), Radim Blazek

Definition in file c_create_idx.c.

Function Documentation

◆ db_create_index()

int db_create_index ( dbDriver driver,
dbIndex index 
)

Create index.

Parameters
driverdb driver
indexindex info (pointer to dbIndex structure)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file c_create_idx.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_INDEX, DB_RECV_RETURN_CODE, DB_RECV_STRING, DB_SEND_INDEX, DB_START_PROCEDURE_CALL, _db_index::indexName, _db_driver::recv, and _db_driver::send.

Referenced by db_create_index2().

◆ db_create_index2()

int db_create_index2 ( dbDriver driver,
const char *  table_name,
const char *  column_name 
)

Create unique index.

Parameters
driverdb driver
table_nametable name
column_namecolumn name (where to create index)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 61 of file c_create_idx.c.

References db_alloc_index_columns(), db_create_index(), db_free_index(), db_init_index(), db_set_index_column_name(), db_set_index_name(), db_set_index_table_name(), db_set_index_type_unique(), and NULL.