Skip to content

unsupported type NULL error only on my machine #3546

Open
@tmvkrpxl0

Description

@tmvkrpxl0

Bug Description

sqlx::query_file!("src/queries/leaderboard.sql") this has error:

unsupported type NULL of column #1 ("user")

the leaderboard.sql in question is:

select
	`user`,
	count(
		distinct date(`joined`, '+09:00')
	) as days,
	coalesce(
		sum(unixepoch(coalesce(`left`, 'now')) - unixepoch(`joined`)),
	0) as `total_duration`
from
	`vc_activities`
group by
	`user`
order by
	`total_duration` desc
limit 5

but this error does not happen on my friend's pc.

Minimal Reproduction

https://github.com/tmvkrpxl0/sqlx-report
I used sqlx-cli to setup database like this:

sqlx database create
sqlx migrate run

Then ran cargo build and got the same error

Info

  • SQLx version: 0.8.2, Both release on crate.io and git clone have this issue
  • SQLx features enabled: ["runtime-tokio", "sqlite"].
  • Database server and version: Me: (3.37.2), My friend: (3.46.1)
  • Operating system: Me: (KDE Neon 22.04), My friend: (Arch linux)
  • rustc --version: rustc 1.81.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions