Skip to content

Ada→C++ migration phase 1: ADO core, Parameters, SQL + parity tests - #2

Open
vibhaseshadri-cognition wants to merge 1 commit into
masterfrom
devin/1789407823-ada-to-cpp-phase1
Open

vibhaseshadri-cognition wants to merge 1 commit into
masterfrom
devin/1789407823-ada-to-cpp-phase1

Conversation

@vibhaseshadri-cognition

Copy link
Copy Markdown

Summary

Kicks off an incremental Ada → C++17 port of Ada Database Objects, living side by side with the Ada sources under cpp/. This PR ports the dependency-free foundation (manifest phase 1) and sets up the structure for every later slice.

Ported (Ada → C++)

  • ADOado.hpp (Identifier, EntityType, ObjectId, Nullable<T>, Blob/BlobRef, Time)
  • ADO.Utils, ADO.Dialectsutils.hpp, dialects.hpp (abstract Dialect with default string/bool escaping)
  • ADO.Parametersparameters.hpp: Parameter = std::variant over the Ada discriminated record; AbstractList/List; Expander interface; expand() reproduces the Ada expander exactly (?, :nnn, :name, $group[name], \x escapes; missing param → "").
  • ADO.SQLsql.hpp: Buffer (reserved-name quoting), Query, UpdateQuery (save_field/append_fields update+insert modes), read_file.
  • Util.Log replaced by a minimal pluggable sink (log.hpp) — no external deps.

Parity testsregtests/src/ado-parameters-tests.adb and ado-sql-tests.adb are mirrored in cpp/tests/ with expected strings copied verbatim (incl. Long_Float'Image' 1.50000000000000E+00', Calendar.Formatting.Image fraction format). Extra Buffer/Query/UpdateQuery generation tests added. All pass under -Wall -Wextra -Wpedantic -Werror:

ctest --test-dir cpp/build
100% tests passed, 0 tests failed out of 2

Migration scaffolding

  • cpp/MIGRATION.md: type-mapping table, 7-phase manifest of all 32 Ada packages + drivers (LOC, target, status), component notes.
  • cpp/PORTING_PLAYBOOK.md: phased, verifiable per-package porting procedure to reuse for each subsequent PR.
  • .github/workflows/cpp.yml: g++/clang++ CMake build + ctest (path-filtered to cpp/).
  • README section pointing to the port.

Notes for reviewers: Identifier is long long (not int64_t) so bind_param(Identifier) resolves unambiguously against the Long_Long_Integer overload on Linux. Named parameters occupy list positions, so ? counts them — this matches Ada and is asserted in test_query.

No Ada sources or Ada regtests were modified.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/a807609f1fdf4ecea7e14dfb45a8f2b1
Open in Devin Desktop: https://app.devin.ai/desktop/session/a807609f1fdf4ecea7e14dfb45a8f2b1?variant=devin
Requested by: @vibhaseshadri-cognition

… SQL with parity tests

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

1 participant