Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6858f7a

Browse filesBrowse files
targosruyadorno
authored andcommitted
src: use env strings to create sqlite results
PR-URL: #55785 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 166ab32 commit 6858f7a
Copy full SHA for 6858f7a

2 files changed

+7-6Lines changed: 7 additions & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/env_properties.h‎

Copy file name to clipboardExpand all lines: src/env_properties.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
V(cached_data_string, "cachedData") \
9191
V(cache_key_string, "cacheKey") \
9292
V(change_string, "change") \
93+
V(changes_string, "changes") \
9394
V(channel_string, "channel") \
9495
V(chunks_sent_since_last_write_string, "chunksSentSinceLastWrite") \
9596
V(clone_unsupported_type_str, "Cannot clone object of unsupported type.") \
@@ -215,6 +216,7 @@
215216
V(jwk_y_string, "y") \
216217
V(kill_signal_string, "killSignal") \
217218
V(kind_string, "kind") \
219+
V(last_insert_rowid_string, "lastInsertRowid") \
218220
V(length_string, "length") \
219221
V(library_string, "library") \
220222
V(line_number_string, "lineNumber") \
Collapse file

‎src/node_sqlite.cc‎

Copy file name to clipboardExpand all lines: src/node_sqlite.cc
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,6 @@ void StatementSync::Run(const FunctionCallbackInfo<Value>& args) {
694694
}
695695

696696
Local<Object> result = Object::New(env->isolate());
697-
Local<String> last_insert_rowid_string =
698-
FIXED_ONE_BYTE_STRING(env->isolate(), "lastInsertRowid");
699-
Local<String> changes_string =
700-
FIXED_ONE_BYTE_STRING(env->isolate(), "changes");
701697
sqlite3_int64 last_insert_rowid =
702698
sqlite3_last_insert_rowid(stmt->db_->Connection());
703699
sqlite3_int64 changes = sqlite3_changes64(stmt->db_->Connection());
@@ -713,9 +709,12 @@ void StatementSync::Run(const FunctionCallbackInfo<Value>& args) {
713709
}
714710

715711
if (result
716-
->Set(env->context(), last_insert_rowid_string, last_insert_rowid_val)
712+
->Set(env->context(),
713+
env->last_insert_rowid_string(),
714+
last_insert_rowid_val)
717715
.IsNothing() ||
718-
result->Set(env->context(), changes_string, changes_val).IsNothing()) {
716+
result->Set(env->context(), env->changes_string(), changes_val)
717+
.IsNothing()) {
719718
return;
720719
}
721720

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.