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
1
vote
0 answers

Can Lucid visualize MobileNet V3 Squeeze/Excite blocks

I've trained a number of graphs using the provided MobileNet V3 definition (small) but when I run (tensorflow) Lucid to generate visualisations Lucid fails with an error. If I modify the definition to exclude the Squeeze/Excite blocks then the…
1
vote
1 answer

Adonis `belongsToMany` relation not working

I have the following models: ServiceCategory: 'use strict' const Model = use('Model') class ServiceCategory extends Model { services() { return this .belongsToMany('App/Models/Service') .withTimestamps() } } module.exports =…
Eleandro Duzentos
  • 1,370
  • 18
  • 36
1
vote
2 answers

Loading `belongsToMany` relation using the `with` method always returning an empty array

I have 2 models, Person and PersonType with a belongsToMany relation. The problem is that when I try to get all the PersonTypes related to a Person using the query().with() method, it is always returning an empty array even if I have the right data…
Eleandro Duzentos
  • 1,370
  • 18
  • 36
0
votes
0 answers

AdonisJS - Lucid ORM Computed Properties undefined

I'm new in AdonisJS. I want to create a simple fullname property using computed properties. But the only fullname value i get is undefined. I'm doing something wrong? I came from Laravel :( Thanks! model ... // COLUMNS @column({ isPrimary: true…
0
votes
0 answers

Adonis.js 5 / Lucid - paginate and orderBy causes duplicate items

When I use orderBy and paginate together I get duplicate items on the second page. I noticed that when I order by the 'id' instead of any of the other columns (including the desired 'update_at' column) theres no duplicates and it appears to work as…
Orbitall
  • 611
  • 11
  • 36
0
votes
0 answers

prevent updating a column in adonisjs 5

I want to prevent a column from updating in model I don't want update a column that is in my model is any way for that like @column({update: false}) public attribute_id: number
0
votes
0 answers

Triggering Lucid cameras with Lidar sensor in a drone-mounted setup

I am working on a drone-mounted setup which consists of one Lidar sensor and two Lucid cameras. Currently, the sensors are triggered by a CPU that is also mounted on the drone. However, triggering the sensors in this way is reducing the…
0
votes
2 answers

How to use query builder with adonis repl

Im trying to figure out how can I manipulate my database using adonis repl. I understand models.User is what I should start with to manipulate Users table and I tried using models.User.query() and this function does exist but I cannot understand how…
w3bsite
  • 181
  • 1
  • 10
0
votes
0 answers

beforeSave event doesnt working on adonis

when I try to use the beforeSave inside the model, nothing happens, in theory the documentation in my code would have to record 334 in the database, but nothing happens, it saves the value that the user typed in the frontent and not 334. in the…
Petronio Amaral
  • 171
  • 1
  • 1
  • 7
0
votes
0 answers

Typescript not identifying property in mixin

I am learning Adonis Js v5 Framework. I trying to make mixin for User Model as documented here: click Below I have attached code and Image of error that I am getting I just want to know Am I doing it in right way or is there any other workaround for…
0
votes
0 answers

How to change Postgres connection at run time using Adonis.js?

I have a stream replication db running and I would like to change the connection to it when the main db fail. I have set up the connection for both dbs on config/database.ts and tried to use the connection menager event as in adonis docs : Doc…
jean.b
  • 13
  • 3
0
votes
1 answer

How to return a result with duplicate id using whereIn in AdonisJs

I have a list of IDs and I want to query the database. I press that it returns in order of index the data that appears in the list of Id. I intend to return a list compatible with the same ID's duplicated and in order. Is there how? Thanks for…
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
0
votes
0 answers

Deleting files associated with a database record, including when the record is deleted with a cascading delete

I'm building an application with AdonisJS. A User can create Blogs which have Posts which have PostImages. These are tables in a PostgreSQL database, with cascading deletes on the foreign keys. (the blog analogy is just for simplified explanation—in…
Obvious_Grapefruit
  • 640
  • 1
  • 8
  • 21
0
votes
1 answer

AdonisJS | Parse Joined ORM Model Before Returning

I'm trying to convert my raw queries into using AdonisJS's built in ORM and QueryBuilder systems, and currently in my raw queries I build objects out of different tables to make for better organization when passed to the front-end for different…
Zach W
  • 27
  • 6
0
votes
1 answer

Storing an array of dates (without times)

I'm trying to store dates (without times) in a PostgreSQL array. For context, let's say these are dates on which a supermarket will be closed: ['2022-12-24', '2022-12-25', '2022-12-26'] The table is called opening_times and there is a column called…
Obvious_Grapefruit
  • 640
  • 1
  • 8
  • 21