PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ShpDumperGetConnectionStringFromConn()

char * ShpDumperGetConnectionStringFromConn ( SHPCONNECTIONCONFIG conn)

Definition at line 1188 of file pgsql2shp-core.c.

1189{
1190 stringbuffer_t cs;
1191 stringbuffer_init(&cs);
1192
1193 if (conn->host)
1194 stringbuffer_aprintf(&cs, " host=%s", conn->host);
1195
1196 if (conn->port)
1197 stringbuffer_aprintf(&cs, " port=%s", conn->port);
1198
1199 if (conn->username)
1200 stringbuffer_aprintf(&cs, " user=%s", conn->username);
1201
1202 if (conn->password)
1203 stringbuffer_aprintf(&cs, " password='%s'", conn->password);
1204
1205 if (conn->database)
1206 stringbuffer_aprintf(&cs, " dbname=%s", conn->database);
1207
1208 if ( ! getenv("PGCLIENTENCODING") )
1209 stringbuffer_append(&cs, " client_encoding=UTF8");
1210
1211 return cs.str_start;
1212}
static SHPCONNECTIONCONFIG * conn
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
void stringbuffer_init(stringbuffer_t *s)
static void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.

References conn, shp_connection_state::database, shp_connection_state::host, shp_connection_state::password, shp_connection_state::port, stringbuffer_t::str_start, stringbuffer_append(), stringbuffer_aprintf(), stringbuffer_init(), and shp_connection_state::username.

Referenced by connection_test(), pgui_action_import(), ShpDumperConnectDatabase(), and update_table_chooser_from_database().

Here is the call graph for this function:
Here is the caller graph for this function: