Skip to content

Postgres materialized views problem #1021

@basilex

Description

@basilex

Hi!
Help needed.

SQLC 1.8.0
Database PostgreSQL 13.2

I have materialized view as shown below:

create materialized view m_lentities_assets as
    select l.id             as lentity_id,
           l.short_name     as lentity_short_name,
           l.full_name      as lentity_full_name,
           l.status         as lentity_status,
           m.role_id        as lentity_role_id,
           a.id             as asset_id,
           a.parent_id      as asset_parent_id,
           a.atypes_id      as asset_atypes_id,
           a.name           as asset_name,
           a.status         as asset_status
      from lentities l,
           assets a,
           lentity_assets m
     where m.lentity_id = l.id
       and m.asset_id = a.id
      with no data;

refresh materialized view m_lentities_assets;

and query respectively:

-- name: MLentitiesAssetsGet :many
select *
  from m_lentities_assets
 order by @sql_order::text
 limit @sql_limit offset @sql_offset;

but im unlucky yet...
Even for the read only selects i can't generate any result...

docker run --rm -v /Users/Stalker/workspace/src/gitlab.com/company/be:/src -w /src kjconroy/sqlc generate
# package dbs
storage/query/m_lentities_assets.sql:1:1: relation "m_lentities_assets" does not exist
make: *** [generate-dbs] Error 1

Any help would be appreciated.
Thanx!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions