SQLite Forum

Timeline
Login

23 forum posts by user vman59 occurring on or before 2020-07-13 12:34:21.

More ↑
2020-07-13
12:34 Reply: Endianness help (artifact: 8d150b255a user: vman59)

Intel is little-endian because if you write the bytes in the order of ascending address, the least significant byte (lsb) is first. When writing the number 12, I write the most significant digit (1) first, so I'd consider that big-endian.

Perhaps it should be called little-beginian, but that's just awkward.

2020-07-12
23:20 Reply: Endianness help (artifact: eb72b50145 user: vman59)

I've read that in Arabic, decimal numbers are little-endian, but when the notation was adopted by Europeans it became big-endian because the writing went from right-to-left to left-right while the numbers themselves kept the same order.

2020-06-29
22:21 Reply: Using a VFS shim together with another user-specified VFS (artifact: da5f0cf027 user: vman59)

You don't need unique names. You unregister the original VFS (putting its VFS object in a private list), them give your shim clone the same name before registering it. I keep thinking there is a supported way to get the list of all current VFS's, but it escapes me right now.

18:40 Edit reply: Using a VFS shim together with another user-specified VFS (artifact: d3cc1a3fe7 user: vman59)

I'd try getting the address of the target VFS, unregistering it, clone your shim VFS and change the name and forwarding VFS, then register your clone. When the user specifes the original VFS name in a URI, sqlite3_find_vfs will then return the clone of your shim. If you have to deal with users loading extensions, you'd also have to hijack the vfs register method in the external API.

18:39 Edit reply: Using a VFS shim together with another user-specified VFS (artifact: 67556dab41 user: vman59)

I'd try getting the address of the target VFS, unregistering it, clone your shim VFS and change the name and forwarding VFS, then register your clone. When the user specifes the original VFS name in a URI, sqlite3_find_vfs will then return the clone of your shim. If you have to deal with user's loading extensions, you'd also have to hijack the vfs register method in the external API.

18:37 Reply: Using a VFS shim together with another user-specified VFS (artifact: c1ca090614 user: vman59)

I'd try getting the address of the target VFS, unregistering it, clone your shim VFS and change the name and forwarding VFS, then register your clone. When the user specifes the original VFS name in a URI, sqlite3_find_vfs will then return the clone of your shim.

14:54 Reply: Beginner: keep getting ...> (artifact: 91e348b00e user: vman59)

I can understand why the shell would want to remain agnostic about the syntax of SQL, but since it's told when a command it incomplete, it could be made to check for unbalanced quotes and issue a warning. Maybe the check could only be made if the last character is a semi-colon.

2020-06-19
20:13 Edit reply: Performance issues with query parameters vs. static strings (artifact: 8a40a1ba95 user: vman59)

I did a quick test and sqlite3_bind_parameter_index() has a big O complexity of N squared. If you are calling that before every bind, I think that is your problem. Just processing the named parameters in the prepare is also N squared, even omitting the sqlite3_bind_parameter_index() call.

20:07 Reply: Performance issues with query parameters vs. static strings (artifact: 1f9fc08342 user: vman59)

I did a quick test and sqlite3_bind_parameter_index() has a big O complexity of N squared. If you are calling that before every bind, I think that is your problem.

15:17 Edit reply: Performance issues with query parameters vs. static strings (artifact: 194e49c390 user: vman59)

And why are you using named parameters and not just binding by index number? The parser has lookup each parameter name to see if it has a previous reference, which could possibly be quite costly when the number of names gets large.

15:17 Reply: Performance issues with query parameters vs. static strings (artifact: ca2a80caa6 user: vman59)

And why are you using named parameters and not just binding by index number? The parser has lookup each parameter name to see if it has a previous reference, which could possibly be quite costly.

15:01 Reply: Performance issues with query parameters vs. static strings (artifact: ae01fb5aa0 user: vman59)

I did an EXPLAIN on those 2 statements and the only difference it displayed was a String8 opcode in the first became a Variable opcode in the second. I assume the vdbe skips a lot of sanity checks when processing a literal versus a variable binding (are mutexes involved?).

2020-06-09
12:23 Edit reply: Constraint Name (artifact: fea07633d5 user: vman59)

The error message for a constraint violation includes the name of the constraint.

12:23 Reply: Constraint Name (artifact: 60bb7242d6 user: vman59)

The error message for a constraint violation gives the name of the constraint.

2020-06-03
13:48 Reply: SELECT * Column Sequence / Order (not ORDER BY) (artifact: 4aded6f899 user: vman59)

The virtual table interface explicitly enumerates the columns in definition order and references the columns by number when calling the virtual table's methods. I think SQLite developers would be reluctant to change internal structures because of the extra work that would entail in preserving this documented interface.

The bigger risk for application coders using "*" is the table gets reconstructed with additional fields.

2020-05-16
21:39 Reply: Feature Request: more flexible timestring parsing (artifact: c952ca8537 user: vman59)

I did something similar, but the extension uses a separate function to set the format string so I don't have to include it explicitly with every invocation of the parse function. I then made the config function an eponymous virtual table so redefining the format is an update to a table rather that a side effect of a function call.

2020-04-14
16:00 Reply: Why is foreign key support based on the connection? (artifact: c5dc50f61b user: vman59)

If you have a bulk update that's already filtering by the referenced table, extra checks of the foreign key constraints are needless overhead. I don't think it's about allowing you to knowingly/willingly violate the constraint.

2020-04-03
00:22 Edit reply: Not seeing error, fresh eyeballs may help (artifact: 5cd315145c user: vman59)

Unless it's a virtual table constructor function, it allows (a,,,b,c) with non-intuitive results.

00:20 Delete reply: Not seeing error, fresh eyeballs may help (artifact: 00846b6e4b user: vman59)
Deleted
00:20 Reply: Not seeing error, fresh eyeballs may help (artifact: e817f08081 user: vman59)

Unless it's a virtual table constructor function.

2020-03-27
13:42 Post: Getting virtual table function in schema. (artifact: 933c87e78b user: vman59)

The table_info pragma will return an error when a virtual table defined in the database schema does not have its constructor function loaded. Is there a formal way to capture the missing function name other than parsing the error message or SQL saved saved in sqlite_master?

2020-03-18
13:58 Reply: Request for comment: New ANALYZE syntax (artifact: 24a324e8e2 user: vman59)

The parenthesis format looks more to the user like the options are additional arguments/modifiers to the analyze function, the USING clause looks like you could be doing the analysis with something else.

2020-03-13
15:13 Post: CREATE VIRTUAL TABLE argument list quirk (artifact: 6e15c4f3af user: vman59)

I notice that "CREATE VIRTUAL TABLE test USING tfunc(A,B,C);" and "CREATE VIRTUAL TABLE test USING tfunc(A,,,B,C);" call tfunc's create/connect function with the same argument list. That it, parsing (A,,,B,C) silently ignores the extraneous commas rather than flag an ostensible syntax error.