Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too strict base_dao (required id and created_at fields) #103

Closed
thibaultcha opened this issue Mar 27, 2015 · 0 comments
Closed

Too strict base_dao (required id and created_at fields) #103

thibaultcha opened this issue Mar 27, 2015 · 0 comments
Assignees
Milestone

Comments

@thibaultcha
Copy link
Member

Because of the base_dao we require every table to have an id and a created_at. This was fine until yesterday when we removed applications and we now have tons of tables not requiring those. Ex:

CREATE TABLE IF NOT EXISTS basicauth_credentials(
  id uuid,
  username text,
  password text,
  consumer_id uuid,
  created_at timestamp,
  PRIMARY KEY (id)
);

CREATE INDEX IF NOT EXISTS ON basicauth_credentials(username);

CREATE TABLE IF NOT EXISTS keyauth_credentials(
  id uuid,
  key text,
  consumer_id uuid,
  created_at timestamp,
  PRIMARY KEY (id)
);

CREATE INDEX IF NOT EXISTS ON keyauth_credentials(key);

Could simply be:

CREATE TABLE IF NOT EXISTS basicauth_credentials(
  username text,
  password text,
  consumer_id uuid,
  created_at timestamp,
  PRIMARY KEY (username)
);

CREATE TABLE IF NOT EXISTS keyauth_credentials(
  key text,
  consumer_id uuid,
  created_at timestamp,
  PRIMARY KEY (key)
);

If we improve the DAO so the select_one, delete methods don't rely only on id and if insert doesn't automatically add an id and a created_at property.

@thibaultcha thibaultcha self-assigned this Mar 27, 2015
@subnetmarco subnetmarco added the dao label May 1, 2015
@thibaultcha thibaultcha added this to the 0.4.0 milestone Jun 8, 2015
thibaultcha added a commit that referenced this issue Jun 12, 2015
- New property on a schema field: `dao_insert_value` to specify this
  value will be set by the DAO. Any previously set value will be
  overriden. Ignored on update operation.
- This property calls a function expected as being part of the `options`
  table given to `validate`. This function will take the field
  definition as a parameter.
- No more constants for schema types for several reasons: lua types
  aren't constants, so string, number, or id are now all on the same
  level: plain strings. It should be considered a **litteral**. It's
  also painful to import constants everywhere, especially in plugins.
  Not much benefits from making those constants.

Partially fixes #103
thibaultcha added a commit that referenced this issue Jun 22, 2015
- New property on a schema field: `dao_insert_value` to specify this
  value will be set by the DAO. Any previously set value will be
  overriden. Ignored on update operation.
- This property calls a function expected as being part of the `options`
  table given to `validate`. This function will take the field
  definition as a parameter.
- No more constants for schema types for several reasons: lua types
  aren't constants, so string, number, or id are now all on the same
  level: plain strings. It should be considered a **litteral**. It's
  also painful to import constants everywhere, especially in plugins.
  Not much benefits from making those constants.

Partially fixes #103
thibaultcha added a commit that referenced this issue Jun 23, 2015
- New property on a schema field: `dao_insert_value` to specify this
  value will be set by the DAO. Any previously set value will be
  overriden. Ignored on update operation.
- This property calls a function expected as being part of the `options`
  table given to `validate`. This function will take the field
  definition as a parameter.
- No more constants for schema types for several reasons: lua types
  aren't constants, so string, number, or id are now all on the same
  level: plain strings. It should be considered a **litteral**. It's
  also painful to import constants everywhere, especially in plugins.
  Not much benefits from making those constants.

Partially fixes #103
ctranxuan pushed a commit to streamdataio/kong that referenced this issue Aug 25, 2015
- New property on a schema field: `dao_insert_value` to specify this
  value will be set by the DAO. Any previously set value will be
  overriden. Ignored on update operation.
- This property calls a function expected as being part of the `options`
  table given to `validate`. This function will take the field
  definition as a parameter.
- No more constants for schema types for several reasons: lua types
  aren't constants, so string, number, or id are now all on the same
  level: plain strings. It should be considered a **litteral**. It's
  also painful to import constants everywhere, especially in plugins.
  Not much benefits from making those constants.

Partially fixes Kong#103


Former-commit-id: 50d0832c2786f235e8b5766be2a6d281a2bc8d11
bungle added a commit that referenced this issue Oct 15, 2021
### Summary

- Add support for scram_sha_256_auth by @murillopaula
- feat(socket) change LuaSec ssl_protocol default options by @jeremymv2 in #103
- Make application_name pg client init param configurable by @mecampbellsoup in #110
- feature: added 'backlog' and 'pool_size' options while using ngx.socket. by @xiaocang in #105

(this commit was included in the PR to also trigger cache flush)
bungle added a commit that referenced this issue Oct 15, 2021
### Summary

- Add support for scram_sha_256_auth by @murillopaula
- feat(socket) change LuaSec ssl_protocol default options by @jeremymv2 in #103
- Make application_name pg client init param configurable by @mecampbellsoup in #110
- feature: added 'backlog' and 'pool_size' options while using ngx.socket. by @xiaocang in #105

(this commit was included in the PR to also trigger cache flush)
bungle added a commit that referenced this issue Oct 15, 2021
### Summary

- Add support for scram_sha_256_auth by @murillopaula
- feat(socket) change LuaSec ssl_protocol default options by @jeremymv2 in #103
- Make application_name pg client init param configurable by @mecampbellsoup in #110
- feature: added 'backlog' and 'pool_size' options while using ngx.socket. by @xiaocang in #105

(this commit was included in the PR to also trigger cache flush)
gszr pushed a commit that referenced this issue Oct 26, 2021
Co-authored-by: Ishmeet Grewal <[email protected]>
gszr pushed a commit that referenced this issue Oct 27, 2021
hutchic pushed a commit that referenced this issue Jun 10, 2022
### Summary

#### libyaml 0.2.2 release

- #95 -- build: do not install config.h
- #97 -- appveyor.yml: fix Release build
- #103 -- Remove unused code in yaml_document_delete
- #104 -- Allow colons in plain scalars inside flow collections
- #109 -- Fix comparison in tests/run-emitter.c
- #117 -- Fix typo error
- #119 -- The closing single quote needs to be indented...
- #121 -- fix token name typos in comments
- #122 -- Revert removing of open_ended after top level plain scalar
- #125 -- Cherry-picks from PR 27
- #135 -- Windows/C89 compatibility
- #136 -- allow override of Windows static lib name

#### libyaml 0.2.3 release

- #130 Fixed typo.
- #144 Fix typo in comment
- #140 Use pointer to const for strings that aren't/shouldn't be modified
- #128 Squash a couple of warnings in example-deconstructor-alt
- #151 Fix spelling for error message
- #161 Make appveyor config be a hidden file
- #159 Add CHANGES file
- #160 Always output document end before directive (YAML 1.2 compatibility)
- #162 Output document end marker after open ended scalars
- #157 change cmake target name from libOFF.a to libyaml.a
- #155 include/yaml.h: fix comments
- #169 Fixed missing token in example
- #127 Avoid recursion in the document loader.
- #172 Support %YAML 1.2 directives
- #66 Change dllexport controlling macro to use _WIN32
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

No branches or pull requests

2 participants