Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 29 00:33

    darkfrog26 on sbt-sonatype-3.9.9

    (compare)

  • Aug 29 00:33
    darkfrog26 closed #31
  • Aug 29 00:33
    darkfrog26 commented #31
  • Aug 29 00:33
    darkfrog26 opened #32
  • Aug 29 00:33

    darkfrog26 on sbt-sonatype-3.9.10

    Update sbt-sonatype to 3.9.10 (compare)

  • Aug 15 00:31
    darkfrog26 opened #31
  • Aug 15 00:31

    darkfrog26 on sbt-sonatype-3.9.9

    Update sbt-sonatype to 3.9.9 (compare)

  • Aug 09 01:16

    darkfrog26 on 3.0

    Migrated core functionality to … (compare)

  • Aug 08 04:58

    darkfrog26 on 3.0

    Tested and completed first laye… (compare)

  • Aug 08 00:32
    darkfrog26 opened #30
  • Aug 08 00:32

    darkfrog26 on sbt-scalajs-1.7.0

    Update sbt-scalajs, scalajs-com… (compare)

  • Aug 05 03:12

    darkfrog26 on 3.0

    Continued work toward 3.0 (compare)

  • Aug 05 01:55

    darkfrog26 on 3.0

    Continued work (compare)

  • Aug 03 14:48

    darkfrog26 on 3.0

    Continued work (compare)

  • Aug 03 14:41
    darkfrog26 closed #26
  • Aug 02 16:08
    dpennell commented #26
  • Aug 02 13:17
    dpennell commented #26
  • Aug 02 13:15
    dpennell commented #26
  • Jul 31 15:48

    darkfrog26 on 3.0

    Continued work toward 3.0 (compare)

  • Jul 30 02:47

    darkfrog26 on 3.0

    Continued work toward 3.0 (compare)

Matt Hicks
@darkfrog26
you should probably use aql interpolation for that query
elyphas
@elyphas
ah ok
is possible to build a query based on another query?
Matt Hicks
@darkfrog26
aqlu will allow you to combine partial queries
elyphas
@elyphas
thank you
elyphas
@elyphas

@darkfrog26 ; Hi, I am very sorry!
but I am having more problems:
I am trying this query:

      val queryDSL = aql { 
                FOR (a) IN database.quitar_tblartic
                SEARCH ANALYZER(d.descripcion 
                  IN TOKENS("PARACETAMOL GOTAS", "text_es"), "text_es") 
                SORT BM25(a) LIMIT 2
                RETURN (a)
            }

but I have this errors:

 not found: value SEARCH
[error]                 SEARCH ANALYZER(d.descripcion 
[error]                 ^
[error] /home/elyphas/Prjs/ws_taak/src/main/scala/scarango/CArticuloScarango.scala:44:33: not found: value d
[error]                 SEARCH ANALYZER(d.descripcion 
[error]                                 ^
[error] /home/elyphas/Prjs/ws_taak/src/main/scala/scarango/CArticuloScarango.scala:45:22: not found: value TOKENS
[error]                   IN TOKENS("PARACETAMOL GOTAS", "text_es"), "text_es") 
[error]                      ^
[error] /home/elyphas/Prjs/ws_taak/src/main/scala/scarango/CArticuloScarango.scala:46:17: missing argument list for method SORT in package query
[error] Unapplied methods are only converted to functions when a function type is expected.
[error] You can make this conversion explicit by writing `SORT _` or `SORT(_)` instead of `SORT`.
[error]                 SORT BM25(a) LIMIT 2
elyphas
@elyphas
This works very good:
  val query = aqlu"""  
                        FOR d IN quitar_tblartic SEARCH ANALYZER(d.descripcion IN TOKENS(${txt},"text_es"), 'text_es')        
                        SORT BM25(d) LIMIT 10
                        RETURN d
                    """
Matt Hicks
@darkfrog26
As I said before, the DSL is incomplete, so there are many features of AQL not implemented.
FYI, unless you are writing partial queries or don't have a development database running, I'd recommend using aql interpolation instead of aqlu
aqlinterpolation gives you the benefit of compile-time validation of your queries
elyphas
@elyphas

As I said before, the DSL is incomplete, so there are many features of AQL not implemented.

Oh yes I remember very well just trying :)

Thank you!
Matt Hicks
@darkfrog26
you're welcome to try your hand at expanding the DSL and submitting a PR
elyphas
@elyphas
Ok :)
elyphas
@elyphas
@darkfrog26; hi, could You tell me, please
Why I am getting only 100 records but in my database I have 900 records?
This is my query. query
by the way in arangodb webUI it shows all records.
this is my scarango code:
        val r = for {
            _ <- database.init()
            results <- database.detailsRecipe.query(qryOutputs).as[ItemOutputs].cursor
        } yield {
            results.result match {
                case Nil => Right(List.empty[ItemOutputs], "NotFoundDoobie()" )
                case x => Right(x, "FoundDoobie()")
            }
        }
        r.transformWith {
            case Success(value) => Future.successful(value)
            case Failure(error) =>
                val err = error.getMessage + "--" + error.getLocalizedMessage //.getCause.getMessage
                Future.successful(Left(err))
        }
elyphas
@elyphas
well, I don't know why, but seems that adding another field solved some problems with the query. I don't understand the relationship
Matt Hicks
@darkfrog26
you may need to specify batchSize
or use paged to page through it
elyphas
@elyphas
ok, thank you
legopiraat
@legopiraat

Hi, i have some troubles setting up a connection to arrangoDB.

I have some code to connect

object Test extends App {

  Profig.initConfiguration()
  database.init()

  database.test.insertOne(User("Henk", 10, "test"))
}

object database extends Graph(databaseName = "Learner", credentials = Some(Credentials("Learner", "testPassword"))) {
  val test: DocumentCollection[User] = vertex[User]
}

After running i get the error message Not initialized: Initializing at com.outr.arango.ArangoDB.session(ArangoDB.scala:26) i can't find a reason why this happens, i tried to figure it out based on the https://github.com/outr/scarango/blob/master/driver/src/test/scala/spec/ArangoDatabaseSpec.scala code.

Matt Hicks
@darkfrog26
There should be an exception higher up
Not initialized usually just means another failure occurred previously that kept it from initializing
legopiraat
@legopiraat
Sadly the log is empty and nothing more is provided.
legopiraat
@legopiraat
Inside the init method a session is created, when i complete that future manually it works in the debugger strangely enough
legopiraat
@legopiraat
Oke so i boiled it down to changing the database.init() to Await.result(database.init(), 1 minute) it works. So i figured onComplete should work as well but it doesn't. I will take a quick look tomorrow time for bed now!
Matt Hicks
@darkfrog26
Ah, I see the problem now. Try changing it to:
database.init().flatMap { _ =>
  database.test.insertOne(User("Henk", 10, "test"))
}
init() needs to complete before continuing
you should probably read up on Futures as you are also risking the application terminating since you aren't waiting for your insert to finish before ending the main method
elyphas
@elyphas
@darkfrog26 ; Hi, sometimes I get this error:
Not initialized: Initializing--Not initialized: Initializing
is from the database connection, am I right?
elyphas
@elyphas
oh yes it is
:-)
seems I need to initialize the connection on a more global scope, am I right?
or is there a way to initialize on this object?
object database extends Graph(databaseName = "example"
elyphas
@elyphas

I tried this:

object database extends Graph(databaseName = "example" ) {
  implicit val ec: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global
  init()

but didn't work,

elyphas
@elyphas

I just put the initialize process on global scope, :)

but now I have and error when I try to delete a document but the document in fact is deleted from the database.

@darkfrog26 : Would You help me? please the error is this:

ws_taak URL: http://localhost:8529/_db/example/_api/document/tblInputs/2021-BOTONES-ENTRADA-DESCONOCIDO?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}--URL: http://localhost:8529/_db/example/_api/document/tblInputs/2021-BOTONES-ENTRADA-DESCONOCIDO?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}
ws_taak The Item thats going to be deleted: tblInputs/2021-BOTONES-ENTRADA-DESCONOCIDO
ws_taak URL: http://localhost:8529/_db/example/_api/document/tblInputs/2021-BOTONES-ENTRADA-DESCONOCIDO?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}--URL: http://localhost:8529/_db/example/_api/document/tblInputs/2021-BOTONES-ENTRADA-DESCONOCIDO?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}
Matt Hicks
@darkfrog26
@elyphas realize that init() is an asynchronous method and needs to complete before you start making calls
elyphas
@elyphas
@darkfrog26 ; oh yes, thank you, seems the problem is solved.
elyphas
@elyphas
@darkfrog26 ; Could You give any idea about Why I get this error?
In fact, the document is deleted from the collection, but give an error with this code:
database.tblinputs.deleteOne(InputsScarango.id("BOTONES"))
ws_taak URL: http://localhost:8529/_db/example/_api/document/tblInputs/BOTONES?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}--URL: http://localhost:8529/_db/example/_api/document/tblInputs/BOTONES?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}
ws_taak URL: http://localhost:8529/_db/example/_api/document/tblInputs/BOTONES?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}--URL: http://localhost:8529/_db/example/_api/document/tblInputs/BOTONES?silent=false&returnOld=false&waitForSync=false (Method: DELETE, Status: HttpResponseStatus(404: Not Found)),
ws_taak Request: No Content,
ws_taak Response: {"code":404,"error":true,"errorMessage":"document not found","errorNum":1202}
ws_taak Right((Inputs(2021,BOTONES,ENTRADA,DESCONOCIDO,1628367176415,None,Some(CHANGOS),,None),DeletedDoobie(Se borro)))
elyphas
@elyphas
Sorry seems that is my code with future,
Matt Hicks
@darkfrog26
You really need to spend some time reading up on Futures. Version 3 of Scarango will be out pretty soon and we'll be switching to cats-effect IO and fs2.Stream and I wish I could say that would be more straight-forward, but it's actually a little more complicated.
elyphas
@elyphas
@darkfrog26 ; Oh yes you're right, :)
Well my problem was that when I came to scala I started with Future a little but the framework I use now use IO from cats and so I made a switching to IO's so now that I is necessary the Future I have troubles, :)
Version 3 of Scarango Oh thank you, is a great framework !!
or lib :)
I use doobie for my previous database in prostgresql