#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

drill.metastore.rdbms: {
  # Data source properits is used to specify connection details to Drill Metastore database
  data_source: {
    # By default, embedded file based SQLite database will be used
    # Note: can be used only in Drill embedded mode
    driver: "org.sqlite.JDBC",
    url: "jdbc:sqlite:"${drill.metastore.rdbms.database.sqlite.path.value}"/sqlite-drill-metastore.db",
    # username: "",
    # password: "",
    properties: {
      # List of Hikari properties: https://github.com/brettwooldridge/HikariCP
      # maxIdle : 8
    }
  }

  # Properties specific to database implementation
  database: {
    sqlite: {
      path: {
        # ${user.home} is equivalent of System.getProperty("user.home")
        # ${drill.exec.zk.root} value will be substituted from Drill main config
        value: ${user.home}"/"${drill.exec.zk.root}"/metastore",
        # SQLite database path must exist, Drill will attempt to create path before data source initialization.
        # Flag can be set to false to skip creation process if path already exists.
        create: true
      }
    }
  }
}
