Skip to content

Commit

Permalink
DBConnection -> DbConnection for the TypeScript API (#2230)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutiertyler authored Feb 11, 2025
1 parent cf68225 commit d191b85
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 150 deletions.
24 changes: 12 additions & 12 deletions crates/cli/src/subcommands/generate/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,23 +348,23 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type})
writeln!(out, "}},");
writeln!(
out,
"// Constructors which are used by the DBConnectionImpl to
"// Constructors which are used by the DbConnectionImpl to
// extract type information from the generated RemoteModule.
//
// NOTE: This is not strictly necessary for `eventContextConstructor` because
// all we do is build a TypeScript object which we could have done inside the
// SDK, but if in the future we wanted to create a class this would be
// necessary because classes have methods, so we'll keep it.
eventContextConstructor: (imp: DBConnectionImpl, event: Event<Reducer>) => {{
eventContextConstructor: (imp: DbConnectionImpl, event: Event<Reducer>) => {{
return {{
...(imp as DBConnection),
...(imp as DbConnection),
event
}}
}},
dbViewConstructor: (imp: DBConnectionImpl) => {{
dbViewConstructor: (imp: DbConnectionImpl) => {{
return new RemoteTables(imp);
}},
reducersConstructor: (imp: DBConnectionImpl, setReducerFlags: SetReducerFlags) => {{
reducersConstructor: (imp: DbConnectionImpl, setReducerFlags: SetReducerFlags) => {{
return new RemoteReducers(imp, setReducerFlags);
}},
setReducerFlagsConstructor: () => {{
Expand Down Expand Up @@ -433,7 +433,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) {
out.indent(1);
writeln!(
out,
"constructor(private connection: DBConnectionImpl, private setCallReducerFlags: SetReducerFlags) {{}}"
"constructor(private connection: DbConnectionImpl, private setCallReducerFlags: SetReducerFlags) {{}}"
);
out.newline();

Expand Down Expand Up @@ -537,7 +537,7 @@ fn print_set_reducer_flags(module: &ModuleDef, out: &mut Indenter) {
fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) {
writeln!(out, "export class RemoteTables {{");
out.indent(1);
writeln!(out, "constructor(private connection: DBConnectionImpl) {{}}");
writeln!(out, "constructor(private connection: DbConnectionImpl) {{}}");

for table in iter_tables(module) {
writeln!(out);
Expand Down Expand Up @@ -571,12 +571,12 @@ fn print_subscription_builder(_module: &ModuleDef, out: &mut Indenter) {
fn print_db_connection(_module: &ModuleDef, out: &mut Indenter) {
writeln!(
out,
"export class DBConnection extends DBConnectionImpl<RemoteTables, RemoteReducers, SetReducerFlags> {{"
"export class DbConnection extends DbConnectionImpl<RemoteTables, RemoteReducers, SetReducerFlags> {{"
);
out.indent(1);
writeln!(
out,
"static builder = (): DBConnectionBuilder<DBConnection, ErrorContext, SubscriptionEventContext> => {{"
"static builder = (): DbConnectionBuilder<DbConnection, ErrorContext, SubscriptionEventContext> => {{"
);
out.indent(1);
writeln!(
Expand Down Expand Up @@ -620,7 +620,7 @@ fn print_spacetimedb_imports(out: &mut Indenter) {
"ConnectionId",
"Timestamp",
"TimeDuration",
"DBConnectionBuilder",
"DbConnectionBuilder",
"TableCache",
"BinaryWriter",
"CallReducerFlags",
Expand All @@ -630,8 +630,8 @@ fn print_spacetimedb_imports(out: &mut Indenter) {
"ErrorContextInterface",
"SubscriptionBuilderImpl",
"BinaryReader",
"DBConnectionImpl",
"DBContext",
"DbConnectionImpl",
"DbContext",
"Event",
"deepEqual",
];
Expand Down
Loading

2 comments on commit d191b85

@github-actions
Copy link

@github-actions github-actions bot commented on d191b85 Feb 11, 2025

Choose a reason for hiding this comment

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

Criterion benchmark results

Error when comparing benchmarks: Couldn't find AWS credentials in environment, credentials file, or IAM role.

Caused by:
Couldn't find AWS credentials in environment, credentials file, or IAM role.

@github-actions
Copy link

@github-actions github-actions bot commented on d191b85 Feb 11, 2025

Choose a reason for hiding this comment

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

Callgrind benchmark results Error when comparing benchmarks: Couldn't find AWS credentials in environment, credentials file, or IAM role.

Caused by:
Couldn't find AWS credentials in environment, credentials file, or IAM role.

Please sign in to comment.