Questions tagged [lucid]

Lucid is the AdonisJS implementation of the active record pattern.

Lucid is the AdonisJS implementation of the active record pattern.

If you’re familiar with Laravel or Ruby on Rails, you’ll find many similarities between Lucid and Laravel’s Eloquent or Rails' Active Record.

Lucid documentation

62 questions
0
votes
1 answer

Where do I check the debugging results of adonis api query?

I read the docs from here : https://docs.adonisjs.com/guides/database/debugging#pretty-print-queries And I try like this : import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' import Database from '@ioc:Adonis/Lucid/Database' import…
0
votes
1 answer

Run first migration SQLite with Adinis 5 - Cannot find module '@vscode/sqlite3'

When i run this command "node ace migration:run" the terminal show me this error: Knex: run $ npm install sqlite3 --save Cannot find module '@vscode/sqlite3' ... ... ... I am using Adonis JS 5 but the SQLite database is not working. Any idea what it…
0
votes
1 answer

How does one find existence of (Adonis Lucid Many-to-Many) children records on one parent that meet a criteria?

I'm trying to find existence of certain Permissions on a single parent Role (many-to-many). const roles = await Role .query() .preload('permissions') this.role = roles.find(role => role.id === someid) const exists =…
Jordan Nelson
  • 453
  • 6
  • 17
0
votes
0 answers

AdonisJS migration to postgresql /kubernetes

hello i am new in kubernetes and i test the deployment of a small app in adonis js with db postgresql , so i want to know how to make a migration of the model present in adonis js automatically after the deployment of the pods and the services Thank…
Ilyes Elayeb
  • 115
  • 1
  • 10
0
votes
1 answer

Insert record in mysql with adonisjs jsonb field

I'm trying to insert a record where one of the fields is of type JSONB Below is the format I'm trying to build and at the end the error that is being issued. The field in question is veiculo orm is trying to access the inside of the json to try to…
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
0
votes
1 answer

How TensorFlow Lucid/visualization by optimisation actually works?

I try to understand this article https://distill.pub/2017/feature-visualization/ also I tried to get into code https://github.com/tensorflow/lucid and check other articles and videos And still I don't really understand how we can to optimise input…
t123
  • 11
  • 5
0
votes
0 answers

how to work on order by relationship column in adonisJs v5?

I have implement the following query in adonisjs v4 : const services = await Service .query() .with('categories') .orderBy('categories.id', 'desc') .fetch() It's work fine. how to i implement the relation column order_by in adonis v5…
0
votes
1 answer

Exception Message -> Array to string conversion" Laravel

I am using Laravel lucid framework and I have to call model setAttribute explicitly but getting below error: ErrorException: Array to string conversion in Code is $user = new…
Bhumi Shah
  • 9,323
  • 7
  • 63
  • 104
0
votes
0 answers

Is there a easier way to make a relationship with "compound keys" in Model?

My code.. ADONIS V4 With the code below I can generate exactly what I want as an output but I think I'm doing it the wrong way. I didn't find anything related on any forum, I believe I don't know what I'm looking for var results = await…
0
votes
2 answers

How to set table name in Lucid Model?

The framework works by convention (e.g. User → users), works well in english, but in anothers languages can be inelegant...
Marcaum54
  • 623
  • 1
  • 6
  • 12
0
votes
2 answers

Is it safe to authorize user models using `instanceof` in JavaScript / TypeScript?

Let's say I have 3 models: Admin, User, Product (I'm using model classes) Only an admin can ADD, UPDATE, DELETE a product and users can only GET products, so I have registered an ACL middleware for corresponding routes. Now in my ACL middleware, I…
0
votes
0 answers

created_at field date update when call save() method

When I update the status field in destroy then update created_at field date. this is my controller code async destroy({ params, request, response }) { try { const Applicationdata = await Application.find(params.id) if…
Amit Kadivar
  • 798
  • 4
  • 12
0
votes
1 answer

make: g: No such file or directory make: *** No rule to make target `g'. Stop

I have a sample makefile called 'g' saved in my user folder. I googled how to properly run make and this article says I should run it like this: make -f g but when I run it the way the article tells me to this is what shows up: make: g: No such…
0
votes
0 answers

Linux vagrantlucid32 make: *** No rule to make target `all'. Stop

When I run the make all command I keep getting: make: *** No rule to make target `all'. Stop. Here is a link to the book I'm following read pages 6-7 maybe this can help solve the problem. On: Linux vagrantlucid32 2.6.32-73-generic-pae…
0
votes
1 answer

How to get the sum of related model results using Lucid Query builder

I am using AdonisJs and I am trying to fetch all projects and the sum of the estimate time of their tasks. My code looks like this const entities = await Project.query() .with('task', (builder) => { builder.select('project_id') …
Mike Athi
  • 23
  • 8