Home / Function/ _create_table_if_not_exists() — langchain Function Reference

_create_table_if_not_exists() — langchain Function Reference

Architecture documentation for the _create_table_if_not_exists() function in entity.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  4913d94d_bd60_eefc_8e42_e5664da21e4e["_create_table_if_not_exists()"]
  40387f29_12a3_f291_fc18_4ce17ac91db3["SQLiteEntityStore"]
  4913d94d_bd60_eefc_8e42_e5664da21e4e -->|defined in| 40387f29_12a3_f291_fc18_4ce17ac91db3
  28535b08_6603_aa75_f05d_abb90636cd88["__init__()"]
  28535b08_6603_aa75_f05d_abb90636cd88 -->|calls| 4913d94d_bd60_eefc_8e42_e5664da21e4e
  bb3de870_d9a2_b2ef_b746_608a90b30ec8["_execute_query()"]
  4913d94d_bd60_eefc_8e42_e5664da21e4e -->|calls| bb3de870_d9a2_b2ef_b746_608a90b30ec8
  style 4913d94d_bd60_eefc_8e42_e5664da21e4e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/memory/entity.py lines 402–411

    def _create_table_if_not_exists(self) -> None:
        """Creates the entity table if it doesn't exist, using safe quoting."""
        # Use standard SQL double quotes for the table name identifier
        create_table_query = f"""
            CREATE TABLE IF NOT EXISTS "{self.full_table_name}" (
                key TEXT PRIMARY KEY,
                value TEXT
            )
        """
        self._execute_query(create_table_query)

Domain

Subdomains

Called By

Frequently Asked Questions

What does _create_table_if_not_exists() do?
_create_table_if_not_exists() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/memory/entity.py.
Where is _create_table_if_not_exists() defined?
_create_table_if_not_exists() is defined in libs/langchain/langchain_classic/memory/entity.py at line 402.
What does _create_table_if_not_exists() call?
_create_table_if_not_exists() calls 1 function(s): _execute_query.
What calls _create_table_if_not_exists()?
_create_table_if_not_exists() is called by 1 function(s): __init__.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free