> ## Documentation Index
> Fetch the complete documentation index at: https://docs.credibledata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get SQL source (deprecated)

> **DEPRECATED**: This endpoint is deprecated and may be removed in future versions.
Use the POST version instead for better security and functionality.

Creates a Malloy source from a SQL statement using the specified connection.
The SQL statement is executed to generate a source definition that can be used in Malloy models.




## OpenAPI

````yaml /dataplane-public-api-doc.yaml get /projects/{projectName}/connections/{connectionName}/sqlSource
openapi: 3.1.0
info:
  title: Malloy Publisher - Semantic Model Serving API
  description: >
    The Malloy Publisher - Semantic Model Serving API provides comprehensive
    access to Malloy packages and their associated resources.

    A Malloy package is a directory containing Malloy models (.malloy files),
    Malloy notebooks (.malloynb files), and embedded databases

    (.parquet files) with a malloy-publisher.json manifest at the package's root
    directory.


    ## Key Features


    - **Project Management**: Create and manage projects with their associated
    packages and connections

    - **Package Lifecycle**: Full CRUD operations for Malloy packages and their
    versions

    - **Model & Notebook Access**: Retrieve and execute Malloy models and
    notebooks

    - **Connection Management**: Secure database connection configuration and
    testing

    - **Query Execution**: Execute queries against models and retrieve results

    - **Watch Mode**: Real-time file watching for development workflows


    ## Resource Hierarchy


    The API follows a hierarchical resource structure:

    ```

    Projects

    ├── Connections

    └── Packages
        ├── Models
        ├── Notebooks
        └── Databases
    ```


    For examples, see the Malloy samples packages
    (https://github.com/malloydata/malloy-samples) repository.
  version: v0
servers:
  - url: https://{organization}.data.credibledata.com/api/v0/
    description: Production API server
    variables:
      organization:
        default: demo
        description: Your organization subdomain
security:
  - bearerAuth: []
tags:
  - name: publisher
    description: Publisher status and health check operations
  - name: projects
    description: >-
      Project lifecycle management including creation, configuration, and
      deletion of data modeling projects
  - name: connections
    description: >-
      Database connection management for secure data source configuration and
      access
  - name: packages
    description: >-
      Package management for Malloy data models, including versioning and
      distribution
  - name: models
    description: Malloy model access and compilation operations
  - name: notebooks
    description: Malloy notebook access and execution operations
  - name: databases
    description: Embedded database management and access
  - name: watch-mode
    description: Real-time file watching for development workflows
paths:
  /projects/{projectName}/connections/{connectionName}/sqlSource:
    get:
      tags:
        - connections
      summary: Get SQL source (deprecated)
      description: >
        **DEPRECATED**: This endpoint is deprecated and may be removed in future
        versions.

        Use the POST version instead for better security and functionality.


        Creates a Malloy source from a SQL statement using the specified
        connection.

        The SQL statement is executed to generate a source definition that can
        be used in Malloy models.
      operationId: get-sqlsource
      parameters:
        - name: projectName
          in: path
          description: Name of the project
          required: true
          schema:
            $ref: '#/components/schemas/IdentifierPattern'
        - name: connectionName
          in: path
          description: Name of the connection
          required: true
          schema:
            $ref: '#/components/schemas/IdentifierPattern'
        - name: sqlStatement
          in: query
          description: SQL statement
          required: false
          schema:
            type: string
      responses:
        '200':
          description: SQL source information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SqlSource'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      deprecated: true
components:
  schemas:
    IdentifierPattern:
      type: string
      pattern: ^[a-zA-Z0-9_-]+$
      description: Standard identifier pattern for resource names
    SqlSource:
      type: object
      properties:
        resource:
          type: string
          description: Resource path to the sql source.
        source:
          type: string
    Error:
      type: object
      description: Standard error response format
      properties:
        message:
          type: string
          description: Human-readable error message describing what went wrong
        details:
          type: string
          description: Additional error details or context
      required:
        - message
  responses:
    Unauthorized:
      description: Unauthorized - authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: The server encountered an internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: >-
        The service is temporarily unavailable, typically due to initialization,
        or draining state (Rolling updates, etc.)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````