1. Packages
  2. Planetscale Provider
  3. API Docs
  4. getDatabases
planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale
planetscale logo
planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale

    Databases DataSource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as planetscale from "@pulumi/planetscale";
    
    const myDatabases = planetscale.getDatabases({
        organization: "...my_organization...",
        q: "...my_q...",
    });
    
    import pulumi
    import pulumi_planetscale as planetscale
    
    my_databases = planetscale.get_databases(organization="...my_organization...",
        q="...my_q...")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/planetscale/planetscale"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := planetscale.GetDatabases(ctx, &planetscale.GetDatabasesArgs{
    			Organization: "...my_organization...",
    			Q:            pulumi.StringRef("...my_q..."),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Planetscale = Pulumi.Planetscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myDatabases = Planetscale.GetDatabases.Invoke(new()
        {
            Organization = "...my_organization...",
            Q = "...my_q...",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.planetscale.PlanetscaleFunctions;
    import com.pulumi.planetscale.inputs.GetDatabasesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var myDatabases = PlanetscaleFunctions.getDatabases(GetDatabasesArgs.builder()
                .organization("...my_organization...")
                .q("...my_q...")
                .build());
    
        }
    }
    
    variables:
      myDatabases:
        fn::invoke:
          function: planetscale:getDatabases
          arguments:
            organization: '...my_organization...'
            q: '...my_q...'
    

    Using getDatabases

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDatabases(args: GetDatabasesArgs, opts?: InvokeOptions): Promise<GetDatabasesResult>
    function getDatabasesOutput(args: GetDatabasesOutputArgs, opts?: InvokeOptions): Output<GetDatabasesResult>
    def get_databases(organization: Optional[str] = None,
                      q: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDatabasesResult
    def get_databases_output(organization: Optional[pulumi.Input[str]] = None,
                      q: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDatabasesResult]
    func GetDatabases(ctx *Context, args *GetDatabasesArgs, opts ...InvokeOption) (*GetDatabasesResult, error)
    func GetDatabasesOutput(ctx *Context, args *GetDatabasesOutputArgs, opts ...InvokeOption) GetDatabasesResultOutput

    > Note: This function is named GetDatabases in the Go SDK.

    public static class GetDatabases 
    {
        public static Task<GetDatabasesResult> InvokeAsync(GetDatabasesArgs args, InvokeOptions? opts = null)
        public static Output<GetDatabasesResult> Invoke(GetDatabasesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDatabasesResult> getDatabases(GetDatabasesArgs args, InvokeOptions options)
    public static Output<GetDatabasesResult> getDatabases(GetDatabasesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: planetscale:index/getDatabases:getDatabases
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Organization string
    The name of the organization the database belongs to
    Q string
    Search term to filter databases by name
    Organization string
    The name of the organization the database belongs to
    Q string
    Search term to filter databases by name
    organization String
    The name of the organization the database belongs to
    q String
    Search term to filter databases by name
    organization string
    The name of the organization the database belongs to
    q string
    Search term to filter databases by name
    organization str
    The name of the organization the database belongs to
    q str
    Search term to filter databases by name
    organization String
    The name of the organization the database belongs to
    q String
    Search term to filter databases by name

    getDatabases Result

    The following output properties are available:

    Datas List<GetDatabasesData>
    Id string
    The provider-assigned unique ID for this managed resource.
    Organization string
    The name of the organization the database belongs to
    Q string
    Search term to filter databases by name
    Datas []GetDatabasesData
    Id string
    The provider-assigned unique ID for this managed resource.
    Organization string
    The name of the organization the database belongs to
    Q string
    Search term to filter databases by name
    datas List<GetDatabasesData>
    id String
    The provider-assigned unique ID for this managed resource.
    organization String
    The name of the organization the database belongs to
    q String
    Search term to filter databases by name
    datas GetDatabasesData[]
    id string
    The provider-assigned unique ID for this managed resource.
    organization string
    The name of the organization the database belongs to
    q string
    Search term to filter databases by name
    datas Sequence[GetDatabasesData]
    id str
    The provider-assigned unique ID for this managed resource.
    organization str
    The name of the organization the database belongs to
    q str
    Search term to filter databases by name
    datas List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    organization String
    The name of the organization the database belongs to
    q String
    Search term to filter databases by name

    Supporting Types

    GetDatabasesData

    AllowDataBranching bool
    Whether seeding branches with data is enabled for all branches
    AtBackupRestoreBranchesLimit bool
    If the database has reached its backup restored branch limit
    AtDevelopmentBranchUsageLimit bool
    If the database has reached its development branch limit
    AutomaticMigrations bool
    Whether to automatically manage Rails migrations during deploy requests
    BranchesCount double
    The total number of database branches
    BranchesUrl string
    The URL to retrieve this database's branches via the API
    CreatedAt string
    When the database was created
    DataImport GetDatabasesDataDataImport
    DefaultBranch string
    The default branch for the database
    DefaultBranchReadOnlyRegionsCount double
    Number of read only regions in the default branch
    DefaultBranchShardCount double
    Number of shards in the default branch
    DefaultBranchTableCount double
    Number of tables in the default branch schema
    DevelopmentBranchesCount double
    The total number of database development branches
    ForeignKeysEnabled bool
    Whether foreign key constraints are enabled
    HtmlUrl string
    The URL to see this database's branches in the web UI
    Id string
    The ID of the database
    InsightsEnabled bool
    True if query insights is enabled for the database
    InsightsRawQueries bool
    Whether raw SQL queries are collected
    IssuesCount double
    The total number of ongoing issues within a database
    Kind string
    The kind of database
    MigrationFramework string
    Framework used for applying migrations
    MigrationTableName string
    Table name to use for copying schema migration data
    MultipleAdminsRequiredForDeletion bool
    If the database requires multiple admins for deletion
    Name string
    Name of the database
    OpenSchemaRecommendationsCount double
    The total number of schema recommendations
    Plan string
    The database plan
    ProductionBranchWebConsole bool
    Whether web console is enabled for production branches
    ProductionBranchesCount double
    The total number of database production branches
    Ready bool
    If the database is ready to be used
    Region GetDatabasesDataRegion
    RequireApprovalForDeploy bool
    Whether an approval is required to deploy schema changes to this database
    ResizeQueued bool
    True if a branch has a queued resize request
    Resizing bool
    True if a branch is currently resizing
    RestrictBranchRegion bool
    Whether to restrict branch creation to one region
    SchemaLastUpdatedAt string
    When the default branch schema was last changed.
    Sharded bool
    If the database is sharded
    State string
    State of the database
    UpdatedAt string
    When the database was last updated
    Url string
    The URL to the database API endpoint
    AllowDataBranching bool
    Whether seeding branches with data is enabled for all branches
    AtBackupRestoreBranchesLimit bool
    If the database has reached its backup restored branch limit
    AtDevelopmentBranchUsageLimit bool
    If the database has reached its development branch limit
    AutomaticMigrations bool
    Whether to automatically manage Rails migrations during deploy requests
    BranchesCount float64
    The total number of database branches
    BranchesUrl string
    The URL to retrieve this database's branches via the API
    CreatedAt string
    When the database was created
    DataImport GetDatabasesDataDataImport
    DefaultBranch string
    The default branch for the database
    DefaultBranchReadOnlyRegionsCount float64
    Number of read only regions in the default branch
    DefaultBranchShardCount float64
    Number of shards in the default branch
    DefaultBranchTableCount float64
    Number of tables in the default branch schema
    DevelopmentBranchesCount float64
    The total number of database development branches
    ForeignKeysEnabled bool
    Whether foreign key constraints are enabled
    HtmlUrl string
    The URL to see this database's branches in the web UI
    Id string
    The ID of the database
    InsightsEnabled bool
    True if query insights is enabled for the database
    InsightsRawQueries bool
    Whether raw SQL queries are collected
    IssuesCount float64
    The total number of ongoing issues within a database
    Kind string
    The kind of database
    MigrationFramework string
    Framework used for applying migrations
    MigrationTableName string
    Table name to use for copying schema migration data
    MultipleAdminsRequiredForDeletion bool
    If the database requires multiple admins for deletion
    Name string
    Name of the database
    OpenSchemaRecommendationsCount float64
    The total number of schema recommendations
    Plan string
    The database plan
    ProductionBranchWebConsole bool
    Whether web console is enabled for production branches
    ProductionBranchesCount float64
    The total number of database production branches
    Ready bool
    If the database is ready to be used
    Region GetDatabasesDataRegion
    RequireApprovalForDeploy bool
    Whether an approval is required to deploy schema changes to this database
    ResizeQueued bool
    True if a branch has a queued resize request
    Resizing bool
    True if a branch is currently resizing
    RestrictBranchRegion bool
    Whether to restrict branch creation to one region
    SchemaLastUpdatedAt string
    When the default branch schema was last changed.
    Sharded bool
    If the database is sharded
    State string
    State of the database
    UpdatedAt string
    When the database was last updated
    Url string
    The URL to the database API endpoint
    allowDataBranching Boolean
    Whether seeding branches with data is enabled for all branches
    atBackupRestoreBranchesLimit Boolean
    If the database has reached its backup restored branch limit
    atDevelopmentBranchUsageLimit Boolean
    If the database has reached its development branch limit
    automaticMigrations Boolean
    Whether to automatically manage Rails migrations during deploy requests
    branchesCount Double
    The total number of database branches
    branchesUrl String
    The URL to retrieve this database's branches via the API
    createdAt String
    When the database was created
    dataImport GetDatabasesDataDataImport
    defaultBranch String
    The default branch for the database
    defaultBranchReadOnlyRegionsCount Double
    Number of read only regions in the default branch
    defaultBranchShardCount Double
    Number of shards in the default branch
    defaultBranchTableCount Double
    Number of tables in the default branch schema
    developmentBranchesCount Double
    The total number of database development branches
    foreignKeysEnabled Boolean
    Whether foreign key constraints are enabled
    htmlUrl String
    The URL to see this database's branches in the web UI
    id String
    The ID of the database
    insightsEnabled Boolean
    True if query insights is enabled for the database
    insightsRawQueries Boolean
    Whether raw SQL queries are collected
    issuesCount Double
    The total number of ongoing issues within a database
    kind String
    The kind of database
    migrationFramework String
    Framework used for applying migrations
    migrationTableName String
    Table name to use for copying schema migration data
    multipleAdminsRequiredForDeletion Boolean
    If the database requires multiple admins for deletion
    name String
    Name of the database
    openSchemaRecommendationsCount Double
    The total number of schema recommendations
    plan String
    The database plan
    productionBranchWebConsole Boolean
    Whether web console is enabled for production branches
    productionBranchesCount Double
    The total number of database production branches
    ready Boolean
    If the database is ready to be used
    region GetDatabasesDataRegion
    requireApprovalForDeploy Boolean
    Whether an approval is required to deploy schema changes to this database
    resizeQueued Boolean
    True if a branch has a queued resize request
    resizing Boolean
    True if a branch is currently resizing
    restrictBranchRegion Boolean
    Whether to restrict branch creation to one region
    schemaLastUpdatedAt String
    When the default branch schema was last changed.
    sharded Boolean
    If the database is sharded
    state String
    State of the database
    updatedAt String
    When the database was last updated
    url String
    The URL to the database API endpoint
    allowDataBranching boolean
    Whether seeding branches with data is enabled for all branches
    atBackupRestoreBranchesLimit boolean
    If the database has reached its backup restored branch limit
    atDevelopmentBranchUsageLimit boolean
    If the database has reached its development branch limit
    automaticMigrations boolean
    Whether to automatically manage Rails migrations during deploy requests
    branchesCount number
    The total number of database branches
    branchesUrl string
    The URL to retrieve this database's branches via the API
    createdAt string
    When the database was created
    dataImport GetDatabasesDataDataImport
    defaultBranch string
    The default branch for the database
    defaultBranchReadOnlyRegionsCount number
    Number of read only regions in the default branch
    defaultBranchShardCount number
    Number of shards in the default branch
    defaultBranchTableCount number
    Number of tables in the default branch schema
    developmentBranchesCount number
    The total number of database development branches
    foreignKeysEnabled boolean
    Whether foreign key constraints are enabled
    htmlUrl string
    The URL to see this database's branches in the web UI
    id string
    The ID of the database
    insightsEnabled boolean
    True if query insights is enabled for the database
    insightsRawQueries boolean
    Whether raw SQL queries are collected
    issuesCount number
    The total number of ongoing issues within a database
    kind string
    The kind of database
    migrationFramework string
    Framework used for applying migrations
    migrationTableName string
    Table name to use for copying schema migration data
    multipleAdminsRequiredForDeletion boolean
    If the database requires multiple admins for deletion
    name string
    Name of the database
    openSchemaRecommendationsCount number
    The total number of schema recommendations
    plan string
    The database plan
    productionBranchWebConsole boolean
    Whether web console is enabled for production branches
    productionBranchesCount number
    The total number of database production branches
    ready boolean
    If the database is ready to be used
    region GetDatabasesDataRegion
    requireApprovalForDeploy boolean
    Whether an approval is required to deploy schema changes to this database
    resizeQueued boolean
    True if a branch has a queued resize request
    resizing boolean
    True if a branch is currently resizing
    restrictBranchRegion boolean
    Whether to restrict branch creation to one region
    schemaLastUpdatedAt string
    When the default branch schema was last changed.
    sharded boolean
    If the database is sharded
    state string
    State of the database
    updatedAt string
    When the database was last updated
    url string
    The URL to the database API endpoint
    allow_data_branching bool
    Whether seeding branches with data is enabled for all branches
    at_backup_restore_branches_limit bool
    If the database has reached its backup restored branch limit
    at_development_branch_usage_limit bool
    If the database has reached its development branch limit
    automatic_migrations bool
    Whether to automatically manage Rails migrations during deploy requests
    branches_count float
    The total number of database branches
    branches_url str
    The URL to retrieve this database's branches via the API
    created_at str
    When the database was created
    data_import GetDatabasesDataDataImport
    default_branch str
    The default branch for the database
    default_branch_read_only_regions_count float
    Number of read only regions in the default branch
    default_branch_shard_count float
    Number of shards in the default branch
    default_branch_table_count float
    Number of tables in the default branch schema
    development_branches_count float
    The total number of database development branches
    foreign_keys_enabled bool
    Whether foreign key constraints are enabled
    html_url str
    The URL to see this database's branches in the web UI
    id str
    The ID of the database
    insights_enabled bool
    True if query insights is enabled for the database
    insights_raw_queries bool
    Whether raw SQL queries are collected
    issues_count float
    The total number of ongoing issues within a database
    kind str
    The kind of database
    migration_framework str
    Framework used for applying migrations
    migration_table_name str
    Table name to use for copying schema migration data
    multiple_admins_required_for_deletion bool
    If the database requires multiple admins for deletion
    name str
    Name of the database
    open_schema_recommendations_count float
    The total number of schema recommendations
    plan str
    The database plan
    production_branch_web_console bool
    Whether web console is enabled for production branches
    production_branches_count float
    The total number of database production branches
    ready bool
    If the database is ready to be used
    region GetDatabasesDataRegion
    require_approval_for_deploy bool
    Whether an approval is required to deploy schema changes to this database
    resize_queued bool
    True if a branch has a queued resize request
    resizing bool
    True if a branch is currently resizing
    restrict_branch_region bool
    Whether to restrict branch creation to one region
    schema_last_updated_at str
    When the default branch schema was last changed.
    sharded bool
    If the database is sharded
    state str
    State of the database
    updated_at str
    When the database was last updated
    url str
    The URL to the database API endpoint
    allowDataBranching Boolean
    Whether seeding branches with data is enabled for all branches
    atBackupRestoreBranchesLimit Boolean
    If the database has reached its backup restored branch limit
    atDevelopmentBranchUsageLimit Boolean
    If the database has reached its development branch limit
    automaticMigrations Boolean
    Whether to automatically manage Rails migrations during deploy requests
    branchesCount Number
    The total number of database branches
    branchesUrl String
    The URL to retrieve this database's branches via the API
    createdAt String
    When the database was created
    dataImport Property Map
    defaultBranch String
    The default branch for the database
    defaultBranchReadOnlyRegionsCount Number
    Number of read only regions in the default branch
    defaultBranchShardCount Number
    Number of shards in the default branch
    defaultBranchTableCount Number
    Number of tables in the default branch schema
    developmentBranchesCount Number
    The total number of database development branches
    foreignKeysEnabled Boolean
    Whether foreign key constraints are enabled
    htmlUrl String
    The URL to see this database's branches in the web UI
    id String
    The ID of the database
    insightsEnabled Boolean
    True if query insights is enabled for the database
    insightsRawQueries Boolean
    Whether raw SQL queries are collected
    issuesCount Number
    The total number of ongoing issues within a database
    kind String
    The kind of database
    migrationFramework String
    Framework used for applying migrations
    migrationTableName String
    Table name to use for copying schema migration data
    multipleAdminsRequiredForDeletion Boolean
    If the database requires multiple admins for deletion
    name String
    Name of the database
    openSchemaRecommendationsCount Number
    The total number of schema recommendations
    plan String
    The database plan
    productionBranchWebConsole Boolean
    Whether web console is enabled for production branches
    productionBranchesCount Number
    The total number of database production branches
    ready Boolean
    If the database is ready to be used
    region Property Map
    requireApprovalForDeploy Boolean
    Whether an approval is required to deploy schema changes to this database
    resizeQueued Boolean
    True if a branch has a queued resize request
    resizing Boolean
    True if a branch is currently resizing
    restrictBranchRegion Boolean
    Whether to restrict branch creation to one region
    schemaLastUpdatedAt String
    When the default branch schema was last changed.
    sharded Boolean
    If the database is sharded
    state String
    State of the database
    updatedAt String
    When the database was last updated
    url String
    The URL to the database API endpoint

    GetDatabasesDataDataImport

    DataSource GetDatabasesDataDataImportDataSource
    FinishedAt string
    When the import finished
    ImportCheckErrors string
    Errors encountered during the import check
    StartedAt string
    When the import started
    State string
    State of the data import
    DataSource GetDatabasesDataDataImportDataSource
    FinishedAt string
    When the import finished
    ImportCheckErrors string
    Errors encountered during the import check
    StartedAt string
    When the import started
    State string
    State of the data import
    dataSource GetDatabasesDataDataImportDataSource
    finishedAt String
    When the import finished
    importCheckErrors String
    Errors encountered during the import check
    startedAt String
    When the import started
    state String
    State of the data import
    dataSource GetDatabasesDataDataImportDataSource
    finishedAt string
    When the import finished
    importCheckErrors string
    Errors encountered during the import check
    startedAt string
    When the import started
    state string
    State of the data import
    data_source GetDatabasesDataDataImportDataSource
    finished_at str
    When the import finished
    import_check_errors str
    Errors encountered during the import check
    started_at str
    When the import started
    state str
    State of the data import
    dataSource Property Map
    finishedAt String
    When the import finished
    importCheckErrors String
    Errors encountered during the import check
    startedAt String
    When the import started
    state String
    State of the data import

    GetDatabasesDataDataImportDataSource

    Database string
    Database name of the data source
    Hostname string
    Hostname of the data source
    Port double
    Port of the data source
    Database string
    Database name of the data source
    Hostname string
    Hostname of the data source
    Port float64
    Port of the data source
    database String
    Database name of the data source
    hostname String
    Hostname of the data source
    port Double
    Port of the data source
    database string
    Database name of the data source
    hostname string
    Hostname of the data source
    port number
    Port of the data source
    database str
    Database name of the data source
    hostname str
    Hostname of the data source
    port float
    Port of the data source
    database String
    Database name of the data source
    hostname String
    Hostname of the data source
    port Number
    Port of the data source

    GetDatabasesDataRegion

    CurrentDefault bool
    True if the region is the default for new branch creation
    DisplayName string
    Name of the region
    Enabled bool
    Whether or not the region is currently active
    Id string
    The ID of the region
    Location string
    Location of the region
    Provider string
    Provider for the region (ex. AWS)
    PublicIpAddresses List<string>
    Public IP addresses for the region
    Slug string
    The slug of the region
    CurrentDefault bool
    True if the region is the default for new branch creation
    DisplayName string
    Name of the region
    Enabled bool
    Whether or not the region is currently active
    Id string
    The ID of the region
    Location string
    Location of the region
    Provider string
    Provider for the region (ex. AWS)
    PublicIpAddresses []string
    Public IP addresses for the region
    Slug string
    The slug of the region
    currentDefault Boolean
    True if the region is the default for new branch creation
    displayName String
    Name of the region
    enabled Boolean
    Whether or not the region is currently active
    id String
    The ID of the region
    location String
    Location of the region
    provider String
    Provider for the region (ex. AWS)
    publicIpAddresses List<String>
    Public IP addresses for the region
    slug String
    The slug of the region
    currentDefault boolean
    True if the region is the default for new branch creation
    displayName string
    Name of the region
    enabled boolean
    Whether or not the region is currently active
    id string
    The ID of the region
    location string
    Location of the region
    provider string
    Provider for the region (ex. AWS)
    publicIpAddresses string[]
    Public IP addresses for the region
    slug string
    The slug of the region
    current_default bool
    True if the region is the default for new branch creation
    display_name str
    Name of the region
    enabled bool
    Whether or not the region is currently active
    id str
    The ID of the region
    location str
    Location of the region
    provider str
    Provider for the region (ex. AWS)
    public_ip_addresses Sequence[str]
    Public IP addresses for the region
    slug str
    The slug of the region
    currentDefault Boolean
    True if the region is the default for new branch creation
    displayName String
    Name of the region
    enabled Boolean
    Whether or not the region is currently active
    id String
    The ID of the region
    location String
    Location of the region
    provider String
    Provider for the region (ex. AWS)
    publicIpAddresses List<String>
    Public IP addresses for the region
    slug String
    The slug of the region

    Package Details

    Repository
    planetscale planetscale/terraform-provider-planetscale
    License
    Notes
    This Pulumi package is based on the planetscale Terraform Provider.
    planetscale logo
    planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale
      Meet Neo: Your AI Platform Teammate