MCPcopy Create free account
hub / github.com/ElementsProject/lightning / add_table_singleton

Function add_table_singleton

plugins/sql.c:1908–1926  ·  view source on GitHub ↗

Simple case for arrays of a simple type. */

Source from the content-addressed store, hash-verified

1906
1907/* Simple case for arrays of a simple type. */
1908static void add_table_singleton(struct table_desc *td,
1909 const jsmntok_t *name,
1910 const jsmntok_t *tok)
1911{
1912 struct column *col = tal(td->columns, struct column);
1913 const jsmntok_t *type;
1914
1915 /* FIXME: We would need to return false here and delete table! */
1916 assert(!ignore_column(td, tok));
1917 type = json_get_member(schemas, tok, "type");
1918
1919 col->ftype = find_fieldtype(type);
1920 col->sub = NULL;
1921 /* We name column after the JSON parent field; but jsonname is NULL so we
1922 * know to expect an array not a member. */
1923 col->dbname = db_column_name(col, td, name);
1924 col->jsonname = NULL;
1925 tal_arr_expand(&td->columns, col);
1926}
1927
1928static bool add_deprecated(const char *buffer, const jsmntok_t *tok,
1929 struct column *col)

Callers 1

add_table_propertiesFunction · 0.85

Calls 4

ignore_columnFunction · 0.85
json_get_memberFunction · 0.85
find_fieldtypeFunction · 0.85
db_column_nameFunction · 0.85

Tested by

no test coverage detected