| 2195 | } |
| 2196 | |
| 2197 | int main(int argc, char *argv[]) |
| 2198 | { |
| 2199 | struct sql *sql; |
| 2200 | setup_locale(); |
| 2201 | |
| 2202 | if (argc == 2 && streq(argv[1], "--print-docs")) { |
| 2203 | tablemap tablemap; |
| 2204 | common_setup(argv[0]); |
| 2205 | |
| 2206 | /* plugin is NULL, so just sets up tables */ |
| 2207 | init_tablemap(NULL, &tablemap); |
| 2208 | |
| 2209 | printf("The following tables are currently supported:\n"); |
| 2210 | strmap_iterate(&tablemap, print_one_table, NULL); |
| 2211 | common_shutdown(); |
| 2212 | return 0; |
| 2213 | } |
| 2214 | |
| 2215 | sql = tal(NULL, struct sql); |
| 2216 | sql->dbfilename = NULL; |
| 2217 | sql->gosstore_fd = -1; |
| 2218 | sql->gosstore_nodes_off = sql->gosstore_channels_off = 0; |
| 2219 | sql->next_rowid = 1; |
| 2220 | sql->limit_per_list = 10000; |
| 2221 | plugin_main(argv, init, take(sql), PLUGIN_RESTARTABLE, true, NULL, commands, ARRAY_SIZE(commands), |
| 2222 | NULL, 0, NULL, 0, NULL, 0, |
| 2223 | plugin_option_dev("dev-sqlfilename", |
| 2224 | "string", |
| 2225 | "Use on-disk sqlite3 file instead of in memory (e.g. debugging)", |
| 2226 | charp_option, NULL, &sql->dbfilename), |
| 2227 | plugin_option_dev("dev-sqllistlimit", |
| 2228 | "int", |
| 2229 | "A variable setting for how many chainmoves/channelmoves we fetch at once", |
| 2230 | u32_option, NULL, &sql->limit_per_list), |
| 2231 | NULL); |
| 2232 | } |
nothing calls this directly
no test coverage detected