Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:12

    darkfrog26 on 3.0

    Continued work toward 3.0 (compare)

  • 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)

  • Jul 28 12:57
    dwlizlo closed #22
  • Jul 27 14:58

    darkfrog26 on 3.0

    Continued work (compare)

  • Jul 27 14:30

    darkfrog26 on 3.0

    Fixed unchecked issue (compare)

  • Jul 27 03:23

    darkfrog26 on 3.0

    Continued work on driver (compare)

  • Jul 26 23:36

    darkfrog26 on 3.0

    Continued work on driver (compare)

  • Jul 26 17:56

    darkfrog26 on 3.0

    Continued work on driver Merge remote-tracking branch 'o… Continued work on driver (compare)

  • Jul 26 03:38

    darkfrog26 on 3.0

    Minor updates (compare)

  • Jul 25 17:53

    darkfrog26 on 3.0

    Continued work on driver (compare)

  • Jul 25 00:32
    darkfrog26 opened #29
  • Jul 25 00:32

    darkfrog26 on scalatest-3.2.9

    Update scalatest to 3.2.9 (compare)

  • Jul 25 00:32
    darkfrog26 opened #28
elyphas
@elyphas
Tomorrow i'll try Try catch
elyphas
@elyphas

@darkfrog26 ; hi, sorry I think I sould know how to handle this situation, but I have troubles to manage the catch for errors.
Would You give me any idea? please

 try {
        val query = aqlu"FOR d IN tblrecipe_details FILTER d.folio == $identity RETURN d"
        for {
            _ <- database.init()
            results <- database.detailsRecipe.query(query).as[ItemRecipe].cursor
        } yield {
            Right(results.result, FoundDoobie())
       }
 } catch {
      case e =>
          Future.successful(Left(e.getMessage + " -- " + e.getLocalizedMessage))
}

it doesn't capture any error, I stop the arangodb daemon to test the conection and also doesn't be capture.

Matt Hicks
@darkfrog26
You need to read up on Future failures
and recover
elyphas
@elyphas
ah thank you
elyphas
@elyphas
now is better with transformWith
:)
elyphas
@elyphas
@darkfrog26 ; Hi, Could You tell me? please, Why this string isn't valid?
val query = aqlu"FOR d IN quitar_tblartic2 SEARCH ANALYZER(d.cve_articulo LIKE '%$txt%', 'text_es') RETURN d"
Matt Hicks
@darkfrog26
that query work in the query browser for ArangoDB?
elyphas
@elyphas
yes
none problem
Matt Hicks
@darkfrog26
ah, the problem is that $txt is a String, so the query can't be evaluated at compile-time
elyphas
@elyphas
yes that's my problem
do I need to concatenate aqlu parts?
Matt Hicks
@darkfrog26
probably, or use the DSL
elyphas
@elyphas
ok thank you
elyphas
@elyphas

@darkfrog26 ; Hi, Could You tell me, please, Why I get this error?:

not found: value LIK
[error]                       LIKE(a.cve_articulo, "%1929%")

in this code:

        val queryDSL = aql {
                      FOR (a) IN database.tblartic 
                      LIKE (a.cve_articulo, "%1929%")
                      RETURN (a)
                  }
Matt Hicks
@darkfrog26
BTW, it occurred to me that your previous problem would have likely been solved by using ... LIKE ${s"%$txt"} ...
I believe in the DSL you're using it wrong. I think it should be a.cve_articulo LIKE "%1929%"
elyphas
@elyphas
:)
Thank you
elyphas
@elyphas

@darkfrog26 ; hi, Could You help me? please.
I have this code:

val queryDSL = aql{
                               FOR (i) IN database.detailsRecipe 
                               FILTER ((i.type_document == item.type_document.getOrElse("")) && (item.fiscal_period == i.fiscal_period) && (i.folio == item.folio))                                                        
                          REMOVE (i) IN database.detailsRecipe 
                      }

but is throwing these errors:

[error]  found   : Boolean
[error]  required: com.outr.arango.query.Filter
[error]                           FILTER ((i.type_document == item.type_document.getOrElse("")) && (item.fiscal_period == i.fiscal_period) && (i.folio == item.folio)) 
[error]                                                                                                                                    ^
[error] /home/elyphas/Prjs/ws_taak/src/main/scala/scarango/CItemRecipeScarango.scala:67:27: not found: value REMOVE
[error]                           REMOVE (i) IN database.detailsRecipe
Matt Hicks
@darkfrog26
try === instead of ==
elyphas
@elyphas
it worked, thank you
elyphas
@elyphas
sorry, but the still I have the error REMOVE
any idea, please,
    FOR (i) IN database.detailsRecipe
    FILTER ((i.type_document === item.type_document.getOrElse("")) && (i.fiscal_period === item.fiscal_period) && (i.folio === item.folio))
   REMOVE (i) IN database.detailsRecipe
not found: value REMOVE
[error]                           REMOVE (i) IN database.detailsRecipe
Matt Hicks
@darkfrog26
@elyphas try updating to 2.4.3 as REMOVE hadn't been added to the DSL. The DSL isn't full-featured, just the functionality I was using.
elyphas
@elyphas
ok, thank you
elyphas
@elyphas
it works great, thank you very much! :)
elyphas
@elyphas
@darkfrog26 ; Hi, do You think this is correct?
because I have a lot of errors:
                aql {
                    FOR (r) IN database.recipe
                        LET items = (
                        FOR (i) IN database.detailsRecipe
                            FILTER r.fiscal_period == i.fiscal_period && r.folio == i.folio && r.type_document == i.type_document
                        RETURN i
                    )
                    FOR itemToJoin IN (
                        LENGTH(items) > 0 ? items: [{/* no match exists*/}]
                    )
                    RETURN {
                        "year":                   r.fiscal_period,
                        "folio":                  r.folio,
                        "tipoDocument":           LENGTH(r.type_document) > 0 ? r.type_document: '',
                        "paciente":               r.patient_name,
                        "medico":                 r.physician_name,
                        "diagnostico":            r.diagnostic,
                        "fecha":                  r.date2,
                        "cve_articulo":           concat(['\"', itemToJoin.key_item, '\"']),
                        "descripcion_articulo":   concat(['\"', substring(itemToJoin.description_item,0,60), '\"']),
                        "cantidad":               itemToJoin.supplied
                    }
                }
by the way, I am trying to do this way, because I have no idea, how to query a query, I mean: I have a query stored on arangodb and I want to query from scarango
elyphas
@elyphas

I tried this with scarango

aql { FOR (i) IN database.savetocsv RETURN (i) }

where savetocsv is a query stored in arangodb
I also tried inside arangodb the same query and only get as results []

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