![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
slick知识
文章平均质量分 85
杨过悔
这个作者很懒,什么都没留下…
展开
-
认识slick
1.sclick是?Slick (“Scala Language-Integrated Connection Kit”) is Typesafe‘s Functional Relational Mapping (FRM) library for Scala that makes it easy to work with relational databases. It allows原创 2015-06-17 16:54:04 · 599 阅读 · 0 评论 -
conn 配置
一.1.Using Typesafe Configmydb = { dataSourceClass = "org.postgresql.ds.PGSimpleDataSource" properties = { databaseName = "mydb" user = "myuser" password = "secret" } numThreads原创 2015-06-17 21:45:10 · 1383 阅读 · 0 评论 -
I/O ACTIONS
1.DB操作中的IOAnything that you can execute on a database, whether it is a getting the result of a query (myQuery.result), creating a table (myTable.schema.create), inserting data (myTable += item)原创 2015-06-17 21:55:25 · 563 阅读 · 0 评论 -
slick Hello
slick的语法跟scalaQuery很相近,在学习Play时,有接触过ScalaQuery所以slick应该容易上手,这里记录自己从官方doc摘取的code加以少量整理1.添加依赖libraryDependencies ++= List( "com.typesafe.slick" %% "slick" % "3.0.0", "org.slf4j" % "slf4j-nop" %原创 2015-06-17 18:17:03 · 905 阅读 · 0 评论 -
定义模型
1.支持的类型Numeric types: Byte, Short, Int, Long, BigDecimal, Float, DoubleLOB types: java.sql.Blob, java.sql.Clob, Array[Byte]Date types: java.sql.Date, java.sql.Time, java.sql.TimestampBooleanString原创 2015-06-17 22:30:13 · 494 阅读 · 0 评论 -
slick与mysql
application.confmysql = { url = "jdbc:mysql://localhost:3306/scala" driver = com.mysql.jdbc.Driver user = "root" password = "111111" connectionPool = disabled keepAliveConnection = t原创 2015-06-21 11:47:25 · 1990 阅读 · 0 评论 -
slick使用普通的sql操作数据
1.无论使用slick的"集合"来操作数据还是使用sql来操作数据,最终还是构建DBIOAction,让后交给DB处理,类是FP中monid的action需要注意的是run Run an Action asynchronously and return the result as a Futuresqlu,sql,tsql的字面意思来构建一个DBActionsqlu是用于单行的DM原创 2015-09-13 15:48:44 · 2110 阅读 · 0 评论 -
使用slick的codegen生成table code等
具体的http://slick.typesafe.com/doc/3.0.3/code-generation.htmlobject TableGe extends App{ slick.codegen.SourceCodeGenerator.main( Array("slick.driver.MySQLDriver", "com.mysql.jdbc.Dr原创 2015-09-13 16:28:37 · 1804 阅读 · 0 评论