### Example LakeAPI Config File Source: https://github.com/bmsuisse/lakeapi/blob/main/README.md Defines tables, their parameters, and data sources for the LakeAPI. Supports Delta Lake, DuckDB, and MSSQL. ```yaml tables: - name: fruits tag: test version: 1 api_method: - get - post params: - name: cars operators: - "=" - in - name: fruits operators: - "=" - in datasource: uri: delta/fruits file_type: delta - name: fruits_partition tag: test version: 1 api_method: - get - post params: - name: cars operators: - "=" - in - name: fruits operators: - "=" - in - name: pk combi: - fruits - cars - name: combi combi: - fruits - cars datasource: uri: delta/fruits_partition file_type: delta select: - name: A - name: fruits - name: B - name: cars - name: fake_delta tag: test version: 1 allow_get_all_pages: true api_method: - get - post params: - name: name operators: - "=" - name: name1 operators: - "=" datasource: uri: delta/fake file_type: delta # use duckdb database as file - name: fruits_duck tag: test version: 1 api_method: - get - post datasource: uri: duckdb/fruits.db file_type: duckdb table_name: fruits params: - name: fruits operators: - "=" - in - name: cars operators: - "=" - "in" - name: fake_delta_partition tag: test version: 1 allow_get_all_pages: true api_method: - get - post params: - name: name operators: - "=" - name: name1 operators: - "=" datasource: uri: delta/fake file_type: delta - name: "*" # We're lazy and want to expose all in that folder. Name MUST be * and nothing else tag: startest version: 1 api_method: - post datasource: uri: startest/* # Uri MUST end with /* file_type: delta - name: fruits # But we want to overwrite this one tag: startest version: 1 api_method: - get datasource: uri: startest/fruits/${IN_URI_YOU_CAN_HAVE_ENVIRONMENT_VARIABLES} file_type: delta - name: mssql_department tag: mssql api_method: get engine: odbc #requires the odbc extra datasource: uri: DRIVER={ODBC Driver 18 for SQL Server};SERVER=127.0.0.1,1439;ENCRYPT=yes;TrustServerCertificate=Yes;UID=sa;PWD=${MY_SQL_PWD};Database=AdventureWorks table_name: "HumanResources.Department" params: - GroupName ``` -------------------------------- ### YAML Configuration - Basic Table Setup Source: https://context7.com/bmsuisse/lakeapi/llms.txt Defines tables in YAML files, specifying data sources, API methods (GET/POST), and query parameters. Supports Delta Lake and DuckDB datasources. ```yaml # config.yml app: title: My Data Lake API description: Production data lake endpoints version: "1.0" tables: # Basic Delta Lake table - name: products tag: inventory version: 1 api_method: - get - post params: - name: category operators: - "=" - in - name: price operators: - "=" - ">" - "<" - ">=" - "<=" datasource: uri: delta/products file_type: delta # DuckDB database table - name: customers tag: crm version: 1 api_method: get datasource: uri: duckdb/customers.db file_type: duckdb table_name: customers params: - name: country operators: ["=", "in"] - name: customer_id operators: [">", "=", "<=", "<"] ``` -------------------------------- ### Execute SQL Queries via CLI Source: https://context7.com/bmsuisse/lakeapi/llms.txt Interact with the SQL endpoint to list tables or execute queries using GET and POST methods. ```bash # List available tables for SQL queries curl -u user:password "http://localhost:8080/api/sql/tables" # ["test_fruits", "test_customers", "inventory_products_v2"] # Execute SQL via GET curl -u user:password "http://localhost:8080/api/sql?sql=SELECT%20*%20FROM%20test_fruits%20LIMIT%2010" # Execute SQL via POST (recommended for complex queries) curl -u user:password -X POST "http://localhost:8080/api/sql" \ -H "Content-Type: text/plain" \ -d "SELECT category, COUNT(*) as count, AVG(price) as avg_price FROM inventory_products_v2 GROUP BY category ORDER BY count DESC" # SQL with different output format curl -u user:password -X POST "http://localhost:8080/api/sql?format=parquet" \ -H "Content-Type: text/plain" \ -d "SELECT * FROM test_fruits WHERE fruits = 'apple'" \ -o results.parquet ``` -------------------------------- ### GET /api/v1/inventory/products/metadata_detail Source: https://context7.com/bmsuisse/lakeapi/llms.txt Retrieves detailed metadata for a specific table, including partition information, string lengths, and the full data schema. ```APIDOC ## GET /api/v1/inventory/products/metadata_detail ### Description Retrieves detailed metadata for a specific table, including partition information, string lengths, and the full data schema. ### Method GET ### Endpoint /api/v1/inventory/products/metadata_detail ### Response #### Success Response (200) - **partition_columns** (array) - List of columns used for partitioning. - **partition_values** (array) - List of available partition values. - **max_string_lengths** (object) - Map of column names to their maximum string lengths. - **data_schema** (array) - Detailed schema definition for the table columns. - **modified_date** (string) - ISO 8601 timestamp of the last modification. #### Response Example { "partition_columns": ["category"], "partition_values": [{"category": "Electronics"}, {"category": "Clothing"}], "max_string_lengths": {"name": 128, "description": 1024}, "data_schema": [ {"name": "id", "type": {"type_str": "int64", "orig_type_str": "int64"}}, {"name": "name", "type": {"type_str": "string", "orig_type_str": "string"}, "max_str_length": 128} ], "modified_date": "2024-01-15T10:30:00Z" } ``` -------------------------------- ### Query Data Endpoints with cURL Source: https://context7.com/bmsuisse/lakeapi/llms.txt Perform GET and POST requests to inventory endpoints using filtering, pagination, and column selection. ```bash # Basic GET request with JSON response curl -u user:password "http://localhost:8080/api/v1/inventory/products" # Filter with equality curl -u user:password "http://localhost:8080/api/v1/inventory/products?category=Electronics" # Filter with 'in' operator (multiple values) curl -u user:password "http://localhost:8080/api/v1/inventory/products?category__in=Electronics,Clothing" # Range filters curl -u user:password "http://localhost:8080/api/v1/inventory/products?price__gte=10&price__lte=100" # Pagination with limit and offset curl -u user:password "http://localhost:8080/api/v1/inventory/products?limit=50&offset=100" # Select specific columns curl -u user:password "http://localhost:8080/api/v1/inventory/products?$select=name,price,category" # Get distinct values (max 3 columns) curl -u user:password "http://localhost:8080/api/v1/inventory/products?$select=category&$distinct=true" # POST request with body parameters curl -u user:password -X POST "http://localhost:8080/api/v1/inventory/products" \ -H "Content-Type: application/json" \ -d '{"category": "Electronics", "price__gte": 50}' ``` -------------------------------- ### SQL Execution API Source: https://context7.com/bmsuisse/lakeapi/llms.txt Endpoints for listing available tables for SQL queries and executing SQL statements via GET or POST methods. ```APIDOC ## GET /api/sql/tables ### Description Lists all tables currently available for SQL queries. ### Method GET ### Endpoint /api/sql/tables ## GET /api/sql ### Description Executes a SQL query provided as a query parameter. ### Method GET ### Endpoint /api/sql ### Parameters #### Query Parameters - **sql** (string) - Required - The SQL query to execute. ## POST /api/sql ### Description Executes a complex SQL query provided in the request body. ### Method POST ### Endpoint /api/sql ### Parameters #### Query Parameters - **format** (string) - Optional - The output format (e.g., parquet). ### Request Body - **body** (text/plain) - Required - The SQL query string. ``` -------------------------------- ### Initialize LakeAPI with default configuration Source: https://github.com/bmsuisse/lakeapi/blob/main/README.md Run the application using the default configuration settings. ```python app = FastAPI() async def _init(): await bmsdna.lakeapi.init_lakeapi(app) if __name__ == "__main__": import asyncio asyncio.run(_init()) ``` -------------------------------- ### Initialize LakeAPI with FastAPI Source: https://context7.com/bmsuisse/lakeapi/llms.txt Integrates LakeAPI into an existing FastAPI application. Requires FastAPI and bmsdna.lakeapi imports. Basic authentication and startup configuration can be enabled. ```python import dataclasses import fastapi import bmsdna.lakeapi # Create FastAPI application app = fastapi.FastAPI() # Get default configuration and customize it def_cfg = bmsdna.lakeapi.get_default_config() cfg = dataclasses.replace( def_cfg, enable_sql_endpoint=True, # Enable raw SQL endpoint data_path="data" # Base path for data files ) # Initialize LakeAPI with authentication enabled start_info = bmsdna.lakeapi.init_lakeapi( app, # FastAPI instance use_basic_auth=True, # Enable Basic Auth middleware start_config=cfg, # Startup configuration config="config.yml" # Path to YAML config file ) # Run with uvicorn if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=8080) ``` -------------------------------- ### Initialize LakeAPI with custom configuration Source: https://github.com/bmsuisse/lakeapi/blob/main/README.md Adjust the default configuration using dataclasses.replace before initializing the LakeAPI instance. ```python import dataclasses import bmsdna.lakeapi def_cfg = bmsdna.lakeapi.get_default_config() # Get default startup config cfg = dataclasses.replace(def_cfg, enable_sql_endpoint=True, data_path="tests/data") # Use dataclasses.replace to set the properties you want sti = await bmsdna.lakeapi.init_lakeapi(app, cfg, "config_test.yml") # Enable it. The first parameter is the FastAPI instance, the 2nd one is the basic config and the third one the config of the tables ``` -------------------------------- ### Retrieve Metadata Source: https://context7.com/bmsuisse/lakeapi/llms.txt Fetch schema information for all available tables. ```bash # Get list of all available tables with schemas curl -u user:password "http://localhost:8080/metadata" ``` -------------------------------- ### Manage Users via CLI Source: https://context7.com/bmsuisse/lakeapi/llms.txt Use the CLI tool to add users with Argon2-hashed passwords to the configuration file. ```bash # Add user with auto-generated password add_lakeapi_user myusername --yaml-file config.yml # Output: myusername: Kj9#mP2$xL5n # Add user with specific password add_lakeapi_user admin --password "MySecretPass123!" --yaml-file config.yml ``` -------------------------------- ### Optimize Queries with Partitioning Source: https://context7.com/bmsuisse/lakeapi/llms.txt Implement MD5-based partitioning to improve query performance and data distribution. ```yaml tables: - name: orders tag: sales version: 1 api_method: get params: - name: customer_id # Filter on original column operators: ["="] datasource: uri: delta/orders_partitioned file_type: delta # Delta table partitioned by customer_id_md5_prefix_2 # LakeAPI automatically filters partitions when querying by customer_id ``` ```python # Create partition column when writing data import hashlib def md5_prefix(value: str, chars: int = 2) -> str: return hashlib.md5(str(value).encode()).hexdigest()[:chars] df["customer_id_md5_prefix_2"] = df["customer_id"].apply(lambda x: md5_prefix(x, 2)) # Write partitioned Delta table write_deltalake( "delta/orders_partitioned", df, partition_by=["customer_id_md5_prefix_2"] ) ``` -------------------------------- ### Authenticate via HTTP Source: https://context7.com/bmsuisse/lakeapi/llms.txt Perform authentication using Basic Auth or the Authorization header. ```bash # Authenticate via Basic Auth curl -u myusername:Kj9#mP2$xL5n "http://localhost:8080/api/v1/test/products" # Using Authorization header curl -H "Authorization: Basic bXl1c2VybmFtZTpLajkjbVAyJHhMNW4=" \ "http://localhost:8080/api/v1/test/products" ``` -------------------------------- ### Specify Output Formats Source: https://context7.com/bmsuisse/lakeapi/llms.txt Request data in various formats using the format query parameter or the Accept header. ```bash # JSON (default) curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=json" # Newline-delimited JSON curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=ndjson" # CSV curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=csv" # CSV with semicolon separator curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=scsv" # CSV optimized for Excel (UTF-16LE encoding with BOM) curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=csv4excel" # Excel XLSX curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=xlsx" -o data.xlsx # Apache Parquet curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=parquet" -o data.parquet # Apache Arrow IPC curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=arrow" -o data.arrow # Arrow Stream format curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=arrow-stream" # HTML table curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=html" # XML curl -u user:password "http://localhost:8080/api/v1/test/fruits?format=xml" # Using Accept header curl -u user:password -H "Accept: application/parquet" \ "http://localhost:8080/api/v1/test/fruits" ``` -------------------------------- ### Retrieve Table Metadata via CLI Source: https://context7.com/bmsuisse/lakeapi/llms.txt Fetch detailed schema and partition information for a specific table using curl. ```bash curl -u user:password "http://localhost:8080/api/v1/inventory/products/metadata_detail" ``` -------------------------------- ### Configure Supported File Types Source: https://context7.com/bmsuisse/lakeapi/llms.txt Define various data sources including file-based formats and database connections in YAML. ```yaml tables: # Delta Lake (default) - name: delta_table tag: test datasource: uri: delta/my_table file_type: delta # Parquet files - name: parquet_data tag: test datasource: uri: parquet/data.parquet file_type: parquet # CSV files - name: csv_data tag: test datasource: uri: csv/data.csv file_type: csv # JSON files - name: json_data tag: test datasource: uri: json/data.json file_type: json # Newline-delimited JSON - name: ndjson_data tag: test datasource: uri: ndjson/data.ndjson file_type: ndjson # Arrow IPC files - name: arrow_data tag: test datasource: uri: arrow/data.arrow file_type: arrow # DuckDB database - name: duckdb_table tag: test datasource: uri: duckdb/database.db file_type: duckdb table_name: my_table # Required for database files # SQLite database - name: sqlite_table tag: test datasource: uri: sqlite/database.sqlite file_type: sqlite table_name: customers # ODBC connection (requires 'odbc' extra) - name: mssql_table tag: external engine: odbc datasource: uri: "DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost;Database=mydb;UID=user;PWD=${DB_PASSWORD}" table_name: "dbo.customers" ``` -------------------------------- ### Enable SQL Endpoint in Python Source: https://context7.com/bmsuisse/lakeapi/llms.txt Configure the LakeAPI instance to enable the SQL endpoint using dataclasses. ```python import dataclasses import bmsdna.lakeapi # Enable SQL endpoint in configuration cfg = dataclasses.replace( bmsdna.lakeapi.get_default_config(), enable_sql_endpoint=True ) ``` -------------------------------- ### Customize BasicConfig Options Source: https://context7.com/bmsuisse/lakeapi/llms.txt The BasicConfig dataclass allows customization of LakeAPI's startup behavior. Use get_default_config() and dataclasses.replace() to modify settings like SQL endpoint enablement, data path, and query engine. ```python import dataclasses import bmsdna.lakeapi # Get default configuration default_config = bmsdna.lakeapi.get_default_config() # Customize configuration config = dataclasses.replace( default_config, enable_sql_endpoint=True, # Enable /api/sql endpoint data_path="./lake_data", # Base path for data files default_engine="duckdb", # Default query engine: "duckdb" | "polars" | "odbc" default_chunk_size=10000, # Default batch size for streaming min_search_length=3, # Minimum characters for search queries schema_cache_ttl=300, # Schema cache TTL in seconds (5 minutes) temp_folder_path="/tmp", # Temporary file storage path max_route_init_time=200, # Max seconds for route initialization ) ``` -------------------------------- ### Configure Azure Blob Storage Source: https://context7.com/bmsuisse/lakeapi/llms.txt Define Azure storage accounts and map them to data sources in the configuration. ```yaml accounts: my_azure_account: account_name: mystorageaccount account_key: ${AZURE_STORAGE_KEY} # Use environment variable emulator_account: use_emulator: "true" # Use Azurite emulator default_credentials: account_name: mystorageaccount # Uses Azure Default Credential tables: - name: cloud_data tag: azure api_method: get datasource: uri: "az://container/path/to/data.parquet" file_type: parquet account: my_azure_account # Reference account config - name: cloud_delta tag: azure api_method: get datasource: uri: "az://datalake/delta/products" file_type: delta account: my_azure_account copy_local: true # Cache locally for performance ``` -------------------------------- ### Execute SQL queries Source: https://context7.com/bmsuisse/lakeapi/llms.txt Submits a raw SQL query to the SQL endpoint to perform aggregations. ```python response = client.post("/api/sql", content="SELECT category, SUM(quantity) FROM inventory_products GROUP BY category", headers={"Content-Type": "text/plain"}, params={"format": "json" }) ``` -------------------------------- ### Expose Tables with Wildcards Source: https://context7.com/bmsuisse/lakeapi/llms.txt Use wildcard patterns to automatically expose multiple tables and override specific configurations. ```yaml tables: # Expose all Delta tables in the 'datasets' folder - name: "*" # Wildcard for name tag: datasets version: 1 api_method: - post datasource: uri: datasets/* # Wildcard in URI file_type: delta # Override specific table with custom configuration - name: users # Specific table overrides wildcard tag: datasets version: 1 api_method: - get # Different method than wildcard default params: - name: department operators: ["=", "in"] datasource: uri: datasets/users file_type: delta ``` -------------------------------- ### Configure Full-Text Search Source: https://context7.com/bmsuisse/lakeapi/llms.txt Define searchable columns in the YAML configuration and perform search queries via API. ```yaml tables: - name: articles tag: content version: 1 api_method: - get - post datasource: uri: parquet/articles.parquet file_type: parquet search: - name: search # Parameter name for search query columns: # Columns to search across - "title" - "body" - "author" ``` ```bash # Search for articles containing "machine learning" curl -u user:password "http://localhost:8080/api/v1/content/articles?search=machine%20learning" ``` -------------------------------- ### User Configuration Format Source: https://context7.com/bmsuisse/lakeapi/llms.txt The structure of the users section within the YAML configuration file. ```yaml # config.yml - users section (auto-generated) users: - name: myusername passwordhash: $argon2id$v=19$m=65536,t=3,p=4$...hash... - name: admin passwordhash: $argon2id$v=19$m=65536,t=3,p=4$...hash... ``` -------------------------------- ### Output Formats Source: https://context7.com/bmsuisse/lakeapi/llms.txt LakeAPI supports multiple output formats specified via the `format` query parameter or `Accept` header. ```APIDOC ## GET /api/v1/test/fruits ### Description Retrieves a list of fruits with support for various output formats. ### Method GET ### Endpoint /api/v1/test/fruits ### Query Parameters - **format** (string) - Optional - Specifies the output format. Supported values include: `json` (default), `ndjson`, `csv`, `scsv`, `csv4excel`, `xlsx`, `parquet`, `arrow`, `arrow-stream`, `html`, `xml`. ### Headers - **Accept** (string) - Optional - Can be used instead of the `format` query parameter to specify the desired output format (e.g., `application/parquet`). ### Response Example (JSON) ```json [ { "name": "Apple", "color": "Red" } ] ``` ``` -------------------------------- ### Retrieve data as Parquet Source: https://context7.com/bmsuisse/lakeapi/llms.txt Fetches inventory data in Parquet format and converts it to a pandas DataFrame. ```python response = client.get("/api/v1/inventory/products", params={ "format": "parquet", "limit": -1 # Get all records (if allow_get_all_pages is true) }) table = pq.read_table(io.BytesIO(response.content)) df = table.to_pandas() ``` -------------------------------- ### Run LakeAPI in Standalone Mode Source: https://context7.com/bmsuisse/lakeapi/llms.txt LakeAPI can be run directly using Uvicorn or Gunicorn without custom Python code. Configuration is read from environment variables and a default config.yml file. ```bash # Run with Uvicorn uvicorn bmsdna.lakeapi.standalone:app --host 0.0.0.0 --port 8080 # Run with Gunicorn for production gunicorn bmsdna.lakeapi.standalone:app \ --workers 4 \ --worker-class uvicorn.workers.UvicornWorker \ --bind 0.0.0.0:80 # Environment variables export CONFIG_PATH=config.yml # Path to config file or folder export DATA_PATH=data # Base path for data files export ENABLE_SQL_ENDPOINT=1 # Enable SQL endpoint (optional) ``` -------------------------------- ### Filter data via POST Source: https://context7.com/bmsuisse/lakeapi/llms.txt Sends a POST request with complex filtering criteria to the inventory products endpoint. ```python response = client.post("/api/v1/inventory/products", json={ "category__in": ["Electronics", "Computers"], "price__gte": 100, "price__lte": 500 }) ``` -------------------------------- ### Configure Column Selection and Aliasing Source: https://context7.com/bmsuisse/lakeapi/llms.txt Define table configurations in YAML to rename columns, exclude sensitive data, and set default sorting. ```yaml tables: - name: products_public tag: api version: 1 api_method: get datasource: uri: delta/products file_type: delta select: - name: product_id alias: id # Rename column in API response - name: product_name alias: name - name: list_price alias: price exclude: # Columns to hide from API - internal_notes - cost_price sortby: # Default sort order - by: product_name direction: asc ``` -------------------------------- ### Querying Data Endpoints Source: https://context7.com/bmsuisse/lakeapi/llms.txt Endpoints support filtering, pagination, and multiple output formats via query parameters. ```APIDOC ## GET /api/v1/inventory/products ### Description Retrieves a list of products from the inventory. Supports filtering, pagination, and column selection. ### Method GET ### Endpoint /api/v1/inventory/products ### Query Parameters - **category** (string) - Optional - Filters products by category. - **category__in** (string) - Optional - Filters products by a comma-separated list of categories. - **price__gte** (number) - Optional - Filters products with a price greater than or equal to the specified value. - **price__lte** (number) - Optional - Filters products with a price less than or equal to the specified value. - **limit** (integer) - Optional - Specifies the maximum number of results to return. - **offset** (integer) - Optional - Specifies the number of results to skip. - **$select** (string) - Optional - Comma-separated list of columns to include in the response. - **$distinct** (boolean) - Optional - If true, returns distinct values for the selected columns (max 3 columns). ### Response Example ```json [ { "name": "Laptop", "category": "Electronics", "price": 1200 } ] ``` ``` ```APIDOC ## POST /api/v1/inventory/products ### Description Creates a new product in the inventory. Accepts product details in the request body. ### Method POST ### Endpoint /api/v1/inventory/products ### Request Body - **category** (string) - Required - The category of the product. - **price__gte** (number) - Optional - Minimum price for filtering purposes in the request. ### Request Example ```json { "category": "Electronics", "price__gte": 50 } ``` ### Response Example ```json { "message": "Product created successfully" } ``` ``` -------------------------------- ### Access API via Python Client Source: https://context7.com/bmsuisse/lakeapi/llms.txt Interact with LakeAPI endpoints programmatically using the httpx library. ```python import httpx import pyarrow.parquet as pq import io # Basic JSON request client = httpx.Client(base_url="http://localhost:8080", auth=("user", "password")) # Get data as JSON response = client.get("/api/v1/inventory/products", params={ "category": "Electronics", "limit": 100 }) data = response.json() ``` -------------------------------- ### Configure Geospatial Nearby Search Source: https://context7.com/bmsuisse/lakeapi/llms.txt Define proximity-based search parameters in YAML and query stores by distance. ```yaml tables: - name: stores tag: locations version: 1 api_method: - get - post nearby: - name: nearby # Parameter name lat_col: latitude # Latitude column name lon_col: longitude # Longitude column name datasource: uri: delta/stores file_type: delta ``` ```bash # Find stores within 5000 meters of coordinates (47.3769, 8.5417) curl -u user:password "http://localhost:8080/api/v1/locations/stores?nearby.lat=47.3769&nearby.lon=8.5417&nearby.distance_m=5000" ``` -------------------------------- ### Store Configuration in Delta Table Source: https://context7.com/bmsuisse/lakeapi/llms.txt Embed LakeAPI configuration directly into Delta table properties during write operations. ```python # When writing Delta table, include LakeAPI config in properties import json from deltalake import write_deltalake config = { "params": [ {"name": "category", "operators": ["=", "in"]} ] } write_deltalake( "delta/my_table", df, configuration={"lakeapi.config": json.dumps(config)} ) ``` ```yaml # In config.yml, enable config_from_delta tables: - name: my_table tag: products version: 1 api_method: post config_from_delta: true # Read params/config from Delta table properties datasource: uri: delta/my_table file_type: delta ``` -------------------------------- ### Full-Text Search Configuration Source: https://context7.com/bmsuisse/lakeapi/llms.txt Configures and performs full-text searches on specified tables and columns. ```APIDOC ## GET /api/v1/content/articles ### Description Searches articles based on a full-text query. Results are ordered by relevance and include a `search_score`. ### Method GET ### Endpoint /api/v1/content/articles ### Query Parameters - **search** (string) - Required - The search query string. Special characters should be URL-encoded. ### Response Example ```json { "title": "Introduction to Machine Learning", "body": "Machine learning is a subset of AI...", "author": "John Doe", "search_score": 2.5 } ``` ``` -------------------------------- ### Metadata Endpoints Source: https://context7.com/bmsuisse/lakeapi/llms.txt Provides endpoints for schema introspection and retrieving metadata about available tables. ```APIDOC ## GET /metadata ### Description Retrieves a list of all available tables along with their schemas and API routing information. ### Method GET ### Endpoint /metadata ### Response Example ```json [ { "name": "products", "tag": "inventory", "route": "/api/v1/inventory/products", "methods": ["get", "post"], "file_type": "delta", "uri": "delta/products" } ] ``` ``` -------------------------------- ### Handle Complex JSON Types Source: https://context7.com/bmsuisse/lakeapi/llms.txt Use the jsonify_complex parameter to convert nested structures into JSON strings. ```bash # Without jsonify_complex - returns nested structures (may fail with some formats) curl -u user:password "http://localhost:8080/api/v1/test/nested_data" # With jsonify_complex - converts nested types to JSON strings curl -u user:password "http://localhost:8080/api/v1/test/nested_data?jsonify_complex=true" # Example response with jsonify_complex=true: # { # "id": 1, # "name": "Product A", # "attributes": "{\"color\": \"red\", \"size\": \"large\"}", # Struct as JSON string # "tags": "[\"sale\", \"featured\"]" # Array as JSON string # } # jsonify_complex is automatically enabled for CSV/Excel exports curl -u user:password "http://localhost:8080/api/v1/test/nested_data?format=csv" ``` -------------------------------- ### Geospatial Nearby Search Source: https://context7.com/bmsuisse/lakeapi/llms.txt Performs geospatial searches to find entities within a specified radius. ```APIDOC ## GET /api/v1/locations/stores ### Description Finds stores within a specified distance from given latitude and longitude coordinates. Results are sorted by proximity. ### Method GET ### Endpoint /api/v1/locations/stores ### Query Parameters - **nearby.lat** (number) - Required - The latitude of the search center point. - **nearby.lon** (number) - Required - The longitude of the search center point. - **nearby.distance_m** (number) - Required - The search radius in meters. ### Response Example ```json { "name": "Store A", "latitude": 47.3780, "longitude": 8.5420, "nearby": 125.5 } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.