Skip to content

Allow table inserts without context object#2491

Open
joto wants to merge 1 commit into
osm2pgsql-dev:masterfrom
joto:insert-without-obj
Open

Allow table inserts without context object#2491
joto wants to merge 1 commit into
osm2pgsql-dev:masterfrom
joto:insert-without-obj

Conversation

@joto

@joto joto commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

So far an insert() into a table was only allowed in the node, way and relation processing functions, i.e. those function with a "context object". That makes sense in so far as the id column(s) can only been filled magically if there is a context object. But osm2pgsql has allowed tables without id column(s) for a long time. These tables can now be filled from any processing function, for instance in the after_* callbacks.

It is still not possible to call insert() from the main Lua code outside any of the callbacks. That's because the database connections have not been set up yet.

So far an `insert()` into a table was only allowed in the node, way and
relation processing functions, i.e. those function with a "context
object". That makes sense in so far as the id column(s) can only been
filled magically if there is a context object. But osm2pgsql has allowed
tables without id column(s) for a long time. These tables can now be
filled from any processing function, for instance in the `after_*`
callbacks.

It is still not possible to call `insert()` from the main Lua code
outside any of the callbacks. That's because the database connections
have not been set up yet.
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