[sqlalchemy] Postgres Composite Columns

2017-05-02 Thread Zac Goldstein
Hello, I'm having some difficulty implementing postgres composite columns. I've been working off of the sqlalchemy-utils implementation: http://sqlalchemy-utils.readthedocs.io/en/latest/_modules/sqlalchemy_utils/types/pg_composite.html. I've also looked at relevant posts here, but they all

Re: [sqlalchemy] Postgres Composite Columns

2017-05-02 Thread Zac Goldstein
> https://github.com/kvesteri/sqlalchemy-utils > > > > On 05/02/2017 02:10 PM, Zac Goldstein wrote: > > Hello, > > > > I'm having some difficulty implementing postgres composite columns. > > I've been working off of the sqlalchemy-utils implementation:

Re: [sqlalchemy] Postgres Composite Columns

2017-05-02 Thread Zac Goldstein
that happens to > have the same name. > > > > On 05/02/2017 05:01 PM, Zac Goldstein wrote: > > Thanks for your response Mike. I submitted an issue to the > > sqlalchemy-utils github around the time I made my SO post. Mostly > > though I'm interested in findin

[sqlalchemy] Using column name instead of key in constraints

2017-09-30 Thread Zac Goldstein
Is it possible to use column names instead of keys when creating table constraints? I know ForeignKeyConstraint/ForeignKey have a link_to_name parameter which I've been able to use, but I haven't found a similar option for other constraints. -- SQLAlchemy - The Python SQL Toolkit and Object

Re: [sqlalchemy] Using column name instead of key in constraints

2017-10-02 Thread Zac Goldstein
it is you're trying to do would make it more clear > if additional features should be added. > > > On Sat, Sep 30, 2017 at 6:43 PM, Zac Goldstein <gol...@gmail.com> wrote: > > Is it possible to use column names instead of keys when creating table > > constraints?

[sqlalchemy] ClauseAdapter.traverse alternative?

2018-05-09 Thread Zac Goldstein
I'm trying to use ClauseAdapter.traverse similar to how it's used in your old blog post to substitute columns in arbitrary clauses with columns on a different selectable that share an ancestor: http://techspot.zzzeek.org/archive/2008/01/1/ Even in a simple case using a BinaryExpression,

[sqlalchemy] Re: ClauseAdapter.traverse alternative?

2018-05-09 Thread Zac Goldstein
/sql/util.py#L656). This seems to be working. On Wednesday, May 9, 2018 at 12:28:28 AM UTC-7, Zac Goldstein wrote: > > I'm trying to use ClauseAdapter.traverse similar to how it's used in your > old blog post to substitute columns in arbitrary clauses with columns on a > differen

[sqlalchemy] expunged objects get added back into session

2017-12-30 Thread Zac Goldstein
I'm working in a session with `session.autoflush = False`, but pending objects that I expunge get automatically added back in. It has something to do with references held to the object. The object is not in session.new immediately after expunging, but it seems to get added back in once the

[sqlalchemy] Creating revision for specific object

2019-02-04 Thread Zac Goldstein
Hello, I'm trying to create a revision programatically with the operations also made programatically. I've been trying this hackish approach below, which I now think probably isn't the right way to go due to the internals of AutogenContext, which seems required for rendering. Here's what I

Re: [sqlalchemy] Creating revision for specific object

2019-02-04 Thread Zac Goldstein
p.from_table(t)]) > downgrade_ops = upgrade_ops.reverse() > revision_context.generated_revisions[0].upgrade_ops = upgrade_ops > revision_context.generated_revisions[0].downgrade_ops = downgrade_ops > revision_context.run_no_autogenerate( > command_args["rev_i

[sqlalchemy] SQLi concerns with using unsafe data to make tables

2019-04-06 Thread Zac Goldstein
Hello, I'd like to create tables based off user input, but I'm uncertain about the security implications. Most of the raw text data consists of column and table names, which will be restricted and validated to snake_case with no special characters. I assume I'm okay there, but confirmation

Re: [sqlalchemy] SQLi concerns with using unsafe data to make tables

2019-04-06 Thread Zac Goldstein
/06/execute-using-feature-in-postgresql-84.html `EXECUTE USING` is "100% safe" from injection, but it's not clear to me that that's actually true. On Saturday, April 6, 2019 at 5:00:14 PM UTC-7, Mike Bayer wrote: > > On Sat, Apr 6, 2019 at 6:56 PM Zac Goldstein > wrote: > &g

Re: [sqlalchemy] SQLi concerns with using unsafe data to make tables

2019-04-06 Thread Zac Goldstein
Ok, makes sense. Thanks for the help. On Saturday, April 6, 2019 at 7:04:42 PM UTC-7, Mike Bayer wrote: > > On Sat, Apr 6, 2019 at 8:43 PM Zac Goldstein > wrote: > > > > >they are severe. > > I thought this would likely be the case. Exposure to DoS attacks is