mattpap / IScala

Scala backend for IPython
MIT License
322 stars 49 forks source link

Exception when trying to run on scala 2.11. Exception in thread "RequestsEventLoop" java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (table "history" has more than one primary key) #9

Closed amitsudharshan closed 10 years ago

amitsudharshan commented 10 years ago

In [1]: import java.util.HashMap Exception in thread "RequestsEventLoop" java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (table "history" has more than one primary key) at org.sqlite.DB.newSQLException(DB.java:383) at org.sqlite.DB.newSQLException(DB.java:387) at org.sqlite.DB.throwex(DB.java:374) at org.sqlite.NativeDB.prepare(Native Method) at org.sqlite.DB.prepare(DB.java:123) at org.sqlite.PrepStmt.(PrepStmt.java:42) at org.sqlite.Conn.prepareStatement(Conn.java:404) at org.sqlite.Conn.prepareStatement(Conn.java:399) at scala.slick.jdbc.JdbcBackend$SessionDef$class.prepareStatement(JdbcBackend.scala:152) at scala.slick.jdbc.JdbcBackend$BaseSession.prepareStatement(JdbcBackend.scala:389) at scala.slick.jdbc.JdbcBackend$SessionDef$class.withPreparedStatement(JdbcBackend.scala:190) at scala.slick.jdbc.JdbcBackend$BaseSession.withPreparedStatement(JdbcBackend.scala:389) at scala.slick.driver.JdbcInvokerComponent$DDLInvoker$$anonfun$create$1$$anonfun$apply$mcV$sp$1.apply(JdbcInvokerComponent.scala:50) at scala.slick.driver.JdbcInvokerComponent$DDLInvoker$$anonfun$create$1$$anonfun$apply$mcV$sp$1.apply(JdbcInvokerComponent.scala:49) at scala.collection.Iterator$class.foreach(Iterator.scala:743) at scala.collection.Iterator$JoinIterator.foreach(Iterator.scala:191) at scala.slick.driver.JdbcInvokerComponent$DDLInvoker$$anonfun$create$1.apply$mcV$sp(JdbcInvokerComponent.scala:49) at scala.slick.driver.JdbcInvokerComponent$DDLInvoker$$anonfun$create$1.apply(JdbcInvokerComponent.scala:49) at scala.slick.driver.JdbcInvokerComponent$DDLInvoker$$anonfun$create$1.apply(JdbcInvokerComponent.scala:49) at scala.slick.jdbc.JdbcBackend$BaseSession.withTransaction(JdbcBackend.scala:426) at scala.slick.driver.JdbcInvokerComponent$DDLInvoker.create(JdbcInvokerComponent.scala:48) at org.refptr.iscala.db.DB$$anonfun$db$1$$anonfun$apply$mcV$sp$1.apply(DB.scala:55) at org.refptr.iscala.db.DB$$anonfun$db$1$$anonfun$apply$mcV$sp$1.apply(DB.scala:53) at scala.collection.immutable.List.foreach(List.scala:381) at org.refptr.iscala.db.DB$$anonfun$db$1.apply$mcV$sp(DB.scala:53) at org.refptr.iscala.db.DB$$anonfun$db$1.apply(DB.scala:53) at org.refptr.iscala.db.DB$$anonfun$db$1.apply(DB.scala:53) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)

mattpap commented 10 years ago

Thanks. There is a PR (#8) pending solving this issue. btw. Do you experience the same issue on 2.10?

amitsudharshan commented 10 years ago

I didn't have this issue on 2.10 . I tried taking in the pull request, however I then get the old database issue. I think i need to merge rather than just do the checkout of the branch

Exception in thread "RequestsEventLoop" java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: history) at org.sqlite.DB.newSQLException(DB.java:383) at org.sqlite.DB.newSQLException(DB.java:387) at org.sqlite.DB.throwex(DB.java:374) at org.sqlite.NativeDB.prepare(Native Method) at org.sqlite.DB.prepare(DB.java:123) at org.sqlite.PrepStmt.(PrepStmt.java:42) at org.sqlite.Conn.prepareStatement(Conn.java:404) at org.sqlite.Conn.prepareStatement(Conn.java:399) at scala.slick.jdbc.JdbcBackend$SessionDef$class.prepareStatement(JdbcBackend.scala:152)

mattpap commented 10 years ago

This should be fixed in https://github.com/mattpap/IScala/commit/002e2fcccec2452bcc117b50403ef7a035ba1046. The issue with missing tables should be fixed in https://github.com/mattpap/IScala/commit/f1011457eb0a292af9bc9b0d02a59e22a462c704. Let me know if you have more issues with this.

amitsudharshan commented 10 years ago

Much happiness, works great, thanks!