Adding virtual association in schema

I have two schemas both don’t persist in the data base. Here is the code

    schema "" do
      field(:public_name, :string, virtual: true)
      field(:pass, :integer, virtual: true)
      field(:personal_name, :string, virtual: true)
    end

  schema "" do
   field(:first_name, :string, virtual: true)
   field(:personal_id, :integer, virtual: true)
   field(:last_name, :string, virtual: true)
  end

I am writing test cases for the library and I need virtual associations between these two schemas.

How can I define a virtual association between these two?

Any help will be much appreciated.

Thanks

If you are not persisting the schema, maybe it is better to use embedded_schema. This way, it also allows you to use embeds_one and embeds_many. You can use like “virtual” associations.

But if I do this:

embeds_one :some_config, SomeConfig do
  field :name, :string
  field :age,  :integer
end

I get errors that postgresql doesn’t contain a field called some_config, but this is a virtual association, so I just want it to point to an unpersistable struct called %SomeConfig{}

It seems that using embeds_one exects that a corresponding field exists in the database table of the parent schema.