text stringlengths 0 834k |
|---|
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo set _profile=%%1 |
>>""%dbconsole_command%"" echo :read_profile_start |
>>""%dbconsole_command%"" echo if not ""%%_profile%%"" == """" ( goto :read_profile_end ) |
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo set /p _profile=""Select a profile>"" |
>>""%dbconsole_command%"" echo echo. |
>>""%dbconsole_command%"" echo goto :read_profile_start |
>>""%dbconsole_command%"" echo :read_profile_end |
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo echo. |
>>""%dbconsole_command%"" echo echo Starting sbt console for %%_profile%% ... |
>>""%dbconsole_command%"" echo echo. |
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo call :run_sbt console |
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo exit /b 0 |
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo :edit_config |
>>""%dbconsole_command%"" echo call notepad %%userprofile%%\bin\scalikejdbc-cli\config.properties |
>>""%dbconsole_command%"" echo exit /b 0 |
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo :show_help |
>>""%dbconsole_command%"" echo echo. |
>>""%dbconsole_command%"" echo echo dbconsole is an extended sbt console to connect database easily. |
>>""%dbconsole_command%"" echo echo. |
>>""%dbconsole_command%"" echo echo Usage: |
>>""%dbconsole_command%"" echo echo dbconsole [OPTION]... [PROFILE] |
>>""%dbconsole_command%"" echo echo. |
>>""%dbconsole_command%"" echo echo General options: |
>>""%dbconsole_command%"" echo echo -e, --edit edit configuration, then exit |
>>""%dbconsole_command%"" echo echo -c, --clean clean sbt environment, then exit |
>>""%dbconsole_command%"" echo echo -h, --help show this help, then exit |
>>""%dbconsole_command%"" echo echo. |
>>""%dbconsole_command%"" echo exit /b 0 |
>>""%dbconsole_command%"" echo. |
>>""%dbconsole_command%"" echo :run_sbt |
>>""%dbconsole_command%"" echo call java -Xms256M -Xmx512M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxMetaspaceSize=386M ^^ |
>>""%dbconsole_command%"" echo -jar ""%%~dp0\sbt-launch.jar"" ^^ |
>>""%dbconsole_command%"" echo -Dscalikejdbc-cli.config.profile=%%_profile%% ^^ |
>>""%dbconsole_command%"" echo %%1 |
>>""%dbconsole_command%"" echo exit /b 0 |
>>""%dbconsole_command%"" echo. |
if exist ""%build_sbt%"" ( del /f /q ""%build_sbt%"" ) |
>>""%build_sbt%"" echo resolvers += ""oracle driver repo"" at ""http://dist.codehaus.org/mule/dependencies/maven2"" |
>>""%build_sbt%"" echo. |
>>""%build_sbt%"" echo scalaVersion := ""2.12.6"" |
>>""%build_sbt%"" echo. |
>>""%build_sbt%"" echo libraryDependencies ++= Seq( |
>>""%build_sbt%"" echo ""org.scalikejdbc"" %%%% ""scalikejdbc"" %% ""3.3.0"", |
>>""%build_sbt%"" echo ""org.slf4j"" %% ""slf4j-simple"" %% ""1.7.25"", |
>>""%build_sbt%"" echo ""com.h2database"" %% ""h2"" %% ""1.4.197"", |
>>""%build_sbt%"" echo ""org.apache.derby"" %% ""derby"" %% ""10.14.1.0"", |
>>""%build_sbt%"" echo ""org.xerial"" %% ""sqlite-jdbc"" %% ""3.21.0.1"", |
>>""%build_sbt%"" echo ""org.hsqldb"" %% ""hsqldb"" %% ""2.4.0"", |
>>""%build_sbt%"" echo ""mysql"" %% ""mysql-connector-java"" %% ""5.1.45"", |
>>""%build_sbt%"" echo ""org.postgresql"" %% ""postgresql"" %% ""9.4.1212"" |
>>""%build_sbt%"" echo ) |
>>""%build_sbt%"" echo. |
>>""%build_sbt%"" echo initialCommands := """"""import scalikejdbc._ |
>>""%build_sbt%"" echo import scalikejdbc.StringSQLRunner._ |
>>""%build_sbt%"" echo def initialize() { |
>>""%build_sbt%"" echo val props = new java.util.Properties |
>>""%build_sbt%"" echo using(new java.io.FileInputStream(""config.properties"")) { is =^> props.load(is) } |
>>""%build_sbt%"" echo val profile = Option(System.getProperty(""scalikejdbc-cli.config.profile"")).getOrElse(""default"") |
>>""%build_sbt%"" echo Option(props.get(profile + "".jdbc.url"")).map { obj =^> |
>>""%build_sbt%"" echo val url = obj.toString |
>>""%build_sbt%"" echo if (url.startsWith(""jdbc:postgresql"")) { Class.forName(""org.postgresql.Driver"") |
>>""%build_sbt%"" echo } else if (url.startsWith(""jdbc:mysql"")) { Class.forName(""com.mysql.jdbc.Driver"") |
>>""%build_sbt%"" echo } else if (url.startsWith(""jdbc:h2"")) { Class.forName(""org.h2.Driver"") |
>>""%build_sbt%"" echo } else if (url.startsWith(""jdbc:hsqldb"")) { Class.forName(""org.hsqldb.jdbc.JDBCDriver"") |
>>""%build_sbt%"" echo } else if (url.startsWith(""jdbc:derby"")) { Class.forName(""org.apache.derby.jdbc.EmbeddedDriver"") |
>>""%build_sbt%"" echo } else if (url.startsWith(""jdbc:sqlite"")) { Class.forName(""org.sqlite.JDBC"") |
>>""%build_sbt%"" echo } else { throw new IllegalStateException(""Driver is not found for "" + url) |
>>""%build_sbt%"" echo } |
>>""%build_sbt%"" echo val user = Option(props.get(profile + "".jdbc.username"")).map(_.toString).orNull[String] |
>>""%build_sbt%"" echo val password = Option(props.get(profile + "".jdbc.password"")).map(_.toString).orNull[String] |
>>""%build_sbt%"" echo ConnectionPool.singleton(url, user, password) |
>>""%build_sbt%"" echo }.getOrElse { |
>>""%build_sbt%"" echo throw new IllegalStateException(""JDBC settings for \"""" + profile + ""\"" is not found. Try \""dbconsole --edit\""."") |
>>""%build_sbt%"" echo } |
>>""%build_sbt%"" echo } |
>>""%build_sbt%"" echo initialize() |
>>""%build_sbt%"" echo def describe(table: String) = println(DB.describe(table)) |
>>""%build_sbt%"" echo def tables = println(DB.showTables()) |
>>""%build_sbt%"" echo implicit val session: DBSession = AutoSession |
>>""%build_sbt%"" echo """""" |
echo Command installed to %dbconsole_command% |
echo. |
echo Please add the following path to the 'Path' Environment Variable, |
echo %root_dir% |
echo and then, execute 'dbconsole -h' command. |
echo. |
pause |
exit /b 0 |
*/ @end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.