Implements phase 1 of docs/design-sql-bound-parameters.md: <bind> supplies the value for the next ? placeholder of the enclosing <sql>, with typed validation (int, decimal, date, datetime, bool, ident with allow list), null="empty", and refusal to change the connection character set. - SqlBind.*: MySQL-free placeholder scanning and binding logic - __bind.*, __sql, __mysql: runtime wiring - Tag.cpp, jetc/JetParser.cpp: bind is a void tag in both - jetc/JetCodegen: emit sized ZString literals for text holding a NUL, which previously truncated the compiled page - tests: unit tests, end-to-end test against MySQL (interpreted and jetc-compiled), and the generator for the binary test page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
542 B
C++
27 lines
542 B
C++
#ifndef ____sql_h__
|
|
#define ____sql_h__
|
|
|
|
#include "Tag.h"
|
|
#include "SqlBind.h"
|
|
#include <vector>
|
|
|
|
namespace jet {
|
|
|
|
class __sql : public Tag {
|
|
|
|
public:
|
|
__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
|
|
|
// Called by each <bind> inside this <sql> while its body renders.
|
|
void addBind(BoundValue value) { binds.push_back(std::move(value)); }
|
|
size_t bindCount() const { return binds.size(); }
|
|
|
|
private:
|
|
std::vector<BoundValue> binds;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|