feat(pg-neo-migration): init
This commit is contained in:
BIN
package/postgres/pg-neo-migration/hectic-chan
Executable file
BIN
package/postgres/pg-neo-migration/hectic-chan
Executable file
Binary file not shown.
27
package/postgres/pg-neo-migration/src/main.c
Normal file
27
package/postgres/pg-neo-migration/src/main.c
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "type.c"
|
||||||
|
|
||||||
|
LogLevel currentLogLevel = LOG_LEVEL_DEBUG;
|
||||||
|
|
||||||
|
// TODO: check on the specific psql version
|
||||||
|
int check_psql_installed(void) {
|
||||||
|
int returned = system("psql --version > /dev/null 2>&1");
|
||||||
|
if (returned != 0) {
|
||||||
|
fprintf(stderr, "Error: psql is not installed or not in PATH.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void help_message() {
|
||||||
|
fprintf(stdout, "Usage: TODO");
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
if (!check_psql_installed()) { exit(1); }
|
||||||
|
|
||||||
|
if (argc < 2) {
|
||||||
|
help_message();
|
||||||
|
}
|
||||||
|
}
|
||||||
8
package/postgres/pg-neo-migration/src/type.c
Normal file
8
package/postgres/pg-neo-migration/src/type.c
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
typedef enum {
|
||||||
|
LOG_LEVEL_DEBUG,
|
||||||
|
LOG_LEVEL_LOG,
|
||||||
|
LOG_LEVEL_INFO,
|
||||||
|
LOG_LEVEL_NOTICE,
|
||||||
|
LOG_LEVEL_WARN,
|
||||||
|
LOG_LEVEL_EXCEPTION
|
||||||
|
} LogLevel;
|
||||||
Reference in New Issue
Block a user