mirror of
https://github.com/riwiwa/muzi.git
synced 2025-12-30 12:45:26 -08:00
cleaned up leftover debugging stuff
This commit is contained in:
5
muzi.c
5
muzi.c
@@ -33,13 +33,11 @@ bool table_exists(const char *name, PGconn *conn);
|
|||||||
int create_table(const char *name, PGconn *conn);
|
int create_table(const char *name, PGconn *conn);
|
||||||
|
|
||||||
bool table_exists(const char *name, PGconn *conn) {
|
bool table_exists(const char *name, PGconn *conn) {
|
||||||
const char *paramValues[1] = {name};
|
|
||||||
Oid paramTypes[1] = {25};
|
|
||||||
PGresult *result =
|
PGresult *result =
|
||||||
PQexecParams(conn,
|
PQexecParams(conn,
|
||||||
"SELECT EXISTS (SELECT 1 FROM pg_tables "
|
"SELECT EXISTS (SELECT 1 FROM pg_tables "
|
||||||
"WHERE schemaname = 'public' AND tablename = $1);",
|
"WHERE schemaname = 'public' AND tablename = $1);",
|
||||||
1, paramTypes, paramValues, NULL, NULL, 0);
|
1, NULL, &name, NULL, NULL, 0);
|
||||||
if (PQresultStatus(result) != PGRES_TUPLES_OK) {
|
if (PQresultStatus(result) != PGRES_TUPLES_OK) {
|
||||||
printf("SELECT EXISTS failed: %s\n", PQerrorMessage(conn));
|
printf("SELECT EXISTS failed: %s\n", PQerrorMessage(conn));
|
||||||
PQclear(result);
|
PQclear(result);
|
||||||
@@ -333,7 +331,6 @@ int import_spotify(void) {
|
|||||||
int main(void) {
|
int main(void) {
|
||||||
// import_spotify();
|
// import_spotify();
|
||||||
// add_dir_to_db("./spotify-data/extracted");
|
// add_dir_to_db("./spotify-data/extracted");
|
||||||
json_to_db("test");
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user