Added wow_custom_dbc to generate DBC from sql#5
Open
Turor wants to merge 7 commits intogtker:mainfrom
Open
Conversation
… by extracting dbc directory.
…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.
Feature/export dbcs from database
Owner
|
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. |
Owner
|
Any updates on this? |
Author
|
I got side tracked implementing functionality for my classless core. I’ll bump the cleanup up on my list. |
Author
|
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? |
gtker
reviewed
Apr 9, 2026
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 | ||
| // } |
Owner
There was a problem hiding this comment.
Introducing commented out code. This should be removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Extends wow_dbc and added wow_custom_dbc to construct DBCs from SQL DMLs through a CI.
Summary of Changes
RXML
wow_dbc_converter
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:
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.