Giter Site home page Giter Site logo

freeslick's People

Contributors

fommil avatar geggo98 avatar jonfox avatar mkljakubowski-ltq avatar smootoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freeslick's Issues

Help! Hardware Donation Needed

We have a docker image which can start up a local MSSQL (and potentially other databases), allowing the integration tests to be automatically run against real servers as part of the Pull Request review process.

Unfortunately, in order to deploy the custom docker images we need root access on a network-enabled non-VPS host, that you will keep powered and connected to the interwebz, running Ubuntu Trusty so that we can use it as a dedicated host on shippable (must be non-VPS because we have virtualbox and virtual machines cannot be efficiently nested).

If you can help by donating the hardware, please get in contact!

SQL for "case when BOOLEAN_FIELD..." gets generated wrongly

Assuming that there is table with Boolean field (MSSQL's BIT) when complex queries are generated, "case when..." statements are wrongly generated for queries with Boolean fields, like:
generates wrongly:

case when BOOLEAN_FIELD then 1 else 0

but expected would be something like:

case when BOOLEAN_FIELD = 1 then 1 else 0

I got this problem while doing left join on two tables, where one of them have 1 Boolean column

Exception:

Caused by: java.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near 'then'.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) ~[jtds-1.3.1.jar:1.3.1]
...

Inserting long strings to Oracle

Having a Clob column in Oracle and trying to insert a string over 4000 chars long gives a
ORA-01461: can bind a LONG value only for insert into a LONG column

Stolen code

By authors own admission, this is stolen code.

executing action transactionally vs non-transactionally

I do not know if this is Freeslick issue, but I found out that following code does make changes in DB

val action = Table insertOrUpdate row
Await.result(database.run(action.transactionally), 2 seconds)

but same code without .transactionally doesn't

val action = Table insertOrUpdate row
Await.result(database.run(action), 2 seconds)

but both return 1 as number of affected rows.

Same issue is for delete-ing and update-ing, but read-ing works fine both ways.
Is this a bug in Freeslick or am I doing something wrong?

Push changes upstream

Typesafe announced that the Slcik Extensions (this are the Slick drivers for commercial databases) will become open source, just like the drivers for the open source databases.

We should check what we can push back upstream when this happens (of course depending on the license).

integration tests with MS-SQL

Travis may be able to do this, or somebody might offer a remotely hosted solution. There is a gratis MS-SQL edition.

Not allowed to return ID after insert with the "returning" method

I am trying to execute the following action using the OracleProfile:

db.run( ( items returning items.map( _.cdSID ) ) += newItem )

And I get the error:
slick.SlickException: This DBMS does not allow returning columns from INSERT statements

Is it because this feature is not supported yet or am I overlooking something?

I tried to do it with plain sql but I get a -1 as a result (no rows inserted). I don't know if it is the right approach but I will share it with you anyways:

implicit val setInstant: SetParameter[ByteArrayInputStream] = SetParameter { (stream, pp) =>
  pp.ps.setBlob(1, stream)
}
val insertStatement = (i: Item) => {
  val in = new ByteArrayInputStream(i.content.getBytes("ISO-8859-1"))
  sqlu"""DECLARE transId CDBAN.TBAN_SOLICITUD.CDSID%TYPE; BEGIN INSERT INTO CDBAN.TBAN_SOLICITUD (CDSID, DSCONTENT) VALUES (null, $in) returning CDSID INTO transId; END;"""
}

db.run( insertStatement( item ) )

Query on view via db link in oracle

Querying on view through a db link returns a ORA-00942: table or view does not exist because of additional quotation marks.
Now query looks like:

select * from "link"."view_name";

but expected (working) version is:

select * from link.view_name;

Quick workaround is to create a proxy view as follows:

CREATE VIEW local_view AS SELECT * FROM link.view_name;

Tested on freeslick 3.1.1.1 with oracle 11.2.0.4.0

Document resolver line

Document that you also need this line in build.sbt to make it work:

resolvers += Resolver.sonatypeRepo("snapshots")

using freeslick with play-slick

The configuration steps when using play-slick seem to be different than those listed for just using vanilla slick.

when I do

slick.dbs.default.driver="freeslick.MSSQLServerProfile"

I get

Caused by: slick.SlickException: Error getting instance of Slick driver "freeslick.MSSQLServerProfile.api"
    at slick.backend.DatabaseConfig$.forConfig(DatabaseConfig.scala:65) ~[slick_2.11-3.1.0.jar:na]
    at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.create(SlickApi.scala:89) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get$lzycompute(SlickApi.scala:81) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get(SlickApi.scala:80) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.DefaultSlickApi.dbConfig(SlickApi.scala:66) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.NamedDatabaseConfigProvider$$anon$1.get(SlickModule.scala:59) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.HasDatabaseConfigProvider$class.$init$(DatabaseConfigProvider.scala:180) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at dao.VisitorStatusDAO.<init>(VisitorStatusDAO.scala:14) ~[na:na]
    at dao.VisitorStatusDAO$$FastClassByGuice$$df55dc6e.newInstance(<generated>) ~[na:na]
    at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) ~[guice-4.0.jar:na]
Caused by: java.lang.ClassNotFoundException: freeslick.MSSQLServerProfile.api
    at java.lang.ClassLoader.findClass(ClassLoader.java:530) ~[na:1.8.0_25]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_25]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_25]
    at slick.util.ClassLoaderUtil$$anon$1.loadClass(ClassLoaderUtil.scala:12) ~[slick_2.11-3.1.0.jar:na]
    at slick.backend.DatabaseConfig$.forConfig(DatabaseConfig.scala:63) ~[slick_2.11-3.1.0.jar:na]
    at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.create(SlickApi.scala:89) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get$lzycompute(SlickApi.scala:81) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.DefaultSlickApi$DatabaseConfigFactory.get(SlickApi.scala:80) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.DefaultSlickApi.dbConfig(SlickApi.scala:66) ~[play-slick_2.11-1.1.1.jar:1.1.1]
    at play.api.db.slick.NamedDatabaseConfigProvider$$anon$1.get(SlickModule.scala:59) ~[play-slick_2.11-1.1.1.jar:1.1.1]

I get the same for 'freeslick.MSSQLServerProfile.api' and 'freeslick.MSSQLServerProfile.api._' and any other combination I can think of.

there is a possibly related issue here playframework/play-slick#333 which ends up being a problem in slick itself slick/slick#1152 but that fix should be merged so I dont think its what is causing my issue. I think I am just not understanding how to translate the freeslick config steps into the play-slick config steps

move to shippable

now that we have the custom docker image, we should be using Shippable as the build platform.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.