Skip to content

Conversation

@wkelly17
Copy link
Contributor

@wkelly17 wkelly17 commented Dec 9, 2025

This adds in support for gitea topic.

They have their own table

export const gitTopic = pgTable(
  "git_topic",
  {
    id: serial("id").primaryKey(),
    name: varchar("name", {length: 128}).unique().notNull(),
  },
  (t) => [uniqueIndex("topic_name_idx").on(t.name)]
);

And then a pivot table:

  "repo_topic",
  {
    repoId: integer("repo_id")
      .references(() => gitRepo.id, {onDelete: "cascade"})
      .notNull(),

    topicId: integer("topic_id")
      .references(() => gitTopic.id, {onDelete: "cascade"})
      .notNull(),
  },
  (t) => [
    primaryKey({columns: [t.repoId, t.topicId]}),
    index("topic_idx").on(t.topicId),
  ]
);

And then the code for insertion is in bus-wacsevent-gitTopics.ts

There's a few dependency upgrades I went ahead and did in here as well.

For the query side, you can either go through the pivot table, or you can go through vw_consolidated_repos which I also exposed just as a rest api endpoint as well

@wkelly17 wkelly17 changed the title Dev Add gitea topics Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants