Skip to content

Added wow_custom_dbc to generate DBC from sql#5

Open
Turor wants to merge 7 commits intogtker:mainfrom
Turor:main
Open

Added wow_custom_dbc to generate DBC from sql#5
Turor wants to merge 7 commits intogtker:mainfrom
Turor:main

Conversation

@Turor
Copy link
Copy Markdown

@Turor Turor commented Jan 2, 2026

Overview

Extends wow_dbc and added wow_custom_dbc to construct DBCs from SQL DMLs through a CI.

Summary of Changes

RXML

  • Each table needed to have select statements provided
  • Each table needed its own way to convert from the SQLite representation back into the rust representation
  • Each table needed to be able to write to a file (or any kind of writer)

wow_dbc_converter

  • Extended to expose the functionality of writing a table to a file

wow_custom_dbc

Uses the functionality exposed by the wow_dbc_converter to produce dbc files. The process works by scanning a directory for any files matching the names of DBC files and then executing the SQL statements inside after invoking the corresponding table create statements for those DBCs. After a sqlite database has been created each table will be created as its corresponding DBC file.

Idiosyncrasies:

  • If the dbcs want to be regenerated, the sqlite database that was generated needs to be deleted or a different directory specified.

Background

I've been working on an Azeroth Core module to provide classless world of Warcraft experience which requires extensive DBC editing. I had previously hand constructed the necessary DBC files to allow for classless gameplay but found the process quite tedious. This sub-module is an enhancement to automate a big portion of that process.

This PR is a way to construct DBCs

Remarks

I'm incredibly grateful for the wow_dbc tool. It saved me tons of effort and helped me move forward with my own project.

I'm putting this PR into a draft status for now as there are some compiler warnings I need to puzzle through and clean up.

matthewjmeidt and others added 5 commits December 29, 2025 01:45
…me filename as the dbcs. Writes to \dbc directory in the target directory.
…me filename as the dbcs. Writes to \dbc directory in the target directory.
…ility.dbc, so adjusting the select statement row ordering fixes issues observed when reproducing dbcs.
@Turor Turor marked this pull request as draft January 2, 2026 20:35
@gtker
Copy link
Copy Markdown
Owner

gtker commented Jan 2, 2026

Glad the project could help you. I think this functionality fits with the project. Let me know when your PR is ready for review and I'll take a look.
Don't hesitate to ask if you have any questions.

@gtker
Copy link
Copy Markdown
Owner

gtker commented Feb 23, 2026

Any updates on this?

@Turor
Copy link
Copy Markdown
Author

Turor commented Feb 23, 2026

I got side tracked implementing functionality for my classless core. I’ll bump the cleanup up on my list.

@Turor Turor marked this pull request as ready for review April 8, 2026 16:07
@Turor
Copy link
Copy Markdown
Author

Turor commented Apr 8, 2026

Addressed the compiler warnings introduced.

I should note that I didn't update the pre-generated sql bindings aren't up to date with the most current version of this branch. Should I address that?

Comment on lines +166 to +185
// fn create_lookup_dispatch(s: &mut Writer, descriptions: &[DbcDescription]) {
// s.newline();
// s.wln("/// Maps a table name to its conversion logic and writes the result to the provided writer.");
// s.open_curly("pub(crate) fn read_table(name: &str, rows: &mut rusqlite::Rows<'_>, mut writer: impl std::io::Write) -> Result<(), SqliteError>");
// s.open_curly("match name");
//
// for d in descriptions {
// s.open_curly(format!("\"{}\" =>", d.name()));
// // Call the specific from_rows function
// s.wln(format!("let data = {}_from_rows(rows)?;", d.name().to_snake_case()));
// // Use the DbcTable trait (which data implements) to write the file
// s.wln("data.write(&mut writer).map_err(|e| SqliteError::DbcError(wow_dbc::DbcError::Io(e)))?;");
// s.wln("Ok(())");
// s.closing_curly();
// }
//
// s.wln("_ => Err(SqliteError::FilenameNotFound { name: name.to_string() }),");
// s.closing_curly(); // match
// s.closing_curly(); // fn
// }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing commented out code. This should be removed.

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.

2 participants