[
    {
        "role": "user",
        "content": "in%20sqlite3%2C%20how%20to%20print%20structure%20of%20a%20table%20named%20nodes%3F"
    },
    {
        "role": "assistant",
        "content": "To inspect the structure of a table named `nodes` in SQLite3, here are several reliable methods you can use. You\u2019ll get the table\u2019s schema (columns, types, constraints, etc.).\n\n---\n\n### 1. Using the sqlite3 Shell \u2014 `.schema`\nOpen your database with the `sqlite3` command, then run:\n```\n.schema nodes\n```\nThis special dot-command prints the `CREATE TABLE` SQL statement (plus any `CREATE INDEX` or related statements) for the `nodes` table.  \nReference: `.schema tablename` is detailed in the sqlite3 documentation. ([sqlite.org](https://www.sqlite.org/cli.html?utm_source=openai))\n\n---\n\n### 2. Using `PRAGMA table_info(...)`\nIf you\u2019re already connected inside the sqlite3 shell or using SQLite from a library (e.g. Python, C, etc.), you can run:\n```sql\nPRAGMA table_info('nodes');\n```\nThis returns a result set containing one row per column:\n- `cid`: column id (0-based index)  \n- `name`: column name  \n- `type`: data type  \n- `notnull`: 0 or 1 \u2014 whether NOT NULL is enforced  \n- `dflt_value`: default value, if any  \n- `pk`: 0 or 1 \u2014 whether it's part of the primary key  \n([sqlitetutorial.net](https://www.sqlitetutorial.net/sqlite-describe-table/?utm_source=openai))\n\n---\n\n### 3. Querying the Schema Table\nSQLite stores all schema definitions in a special table called `sqlite_schema` (formerly `sqlite_master`). To see the exact SQL used to create `nodes`, run:\n```sql\nSELECT sql\nFROM sqlite_schema\nWHERE name = 'nodes'\n  AND type = 'table';\n```\nThis gives you the original `CREATE TABLE ...` statement.  \n([sqlitetutorial.net](https://www.sqlitetutorial.net/sqlite-describe-table/?utm_source=openai))\n\n---\n\n### 4. Combination Approach (for completeness)\nIf you want both the DDL plus detailed column metadata:\n\n- Use `.schema nodes` to see how the table and indexes were created.\n- Use `PRAGMA table_info('nodes');` to review each column and its properties.\n- Optionally, query `sqlite_schema` (or `sqlite_master`) for more context like constraints or additional SQL.  \n([sqlitetutorial.net](https://www.sqlitetutorial.net/sqlite-commands/?utm_source=openai))\n\n---\n\nIf you tell me whether you\u2019re in the sqlite3 CLI or using it via a programming language (like Python, etc.), I can show you exactly how to use these in your context."
    }
]