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

How to execute SQL? #26

Closed
ppamorim opened this Issue Apr 24, 2015 · 8 comments

Comments

Projects
None yet
2 participants
@ppamorim

ppamorim commented Apr 24, 2015

Hi, I need execute a SQL to truncate my tables. Do you know any way to do this?

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell Apr 24, 2015

Owner

Just wondering why you would need to do this?

What situation will delete not work for you?

Owner

Stuart-campbell commented Apr 24, 2015

Just wondering why you would need to do this?

What situation will delete not work for you?

@ppamorim

This comment has been minimized.

Show comment
Hide comment
@ppamorim

ppamorim Apr 26, 2015

I need truncate my tables, It have a method to do it?

ppamorim commented Apr 26, 2015

I need truncate my tables, It have a method to do it?

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell Apr 26, 2015

Owner

No you can not directly run sql.

Owner

Stuart-campbell commented Apr 26, 2015

No you can not directly run sql.

@ppamorim

This comment has been minimized.

Show comment
Hide comment
@ppamorim

ppamorim Apr 27, 2015

Can create a it?

ppamorim commented Apr 27, 2015

Can create a it?

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell Apr 27, 2015

Owner

You could create your own initialize method like the one here: https://github.com/Stuart-campbell/RushOrm/blob/master/RushORM/rushandroid/src/main/java/co/uk/rushorm/android/RushAndroid.java

Then hang onto the AndroidRushStatementRunner which would let you run raw sql.

Can you explain your use case for wanting this? If I was going to add this feature to the library I would need to know why.

Owner

Stuart-campbell commented Apr 27, 2015

You could create your own initialize method like the one here: https://github.com/Stuart-campbell/RushOrm/blob/master/RushORM/rushandroid/src/main/java/co/uk/rushorm/android/RushAndroid.java

Then hang onto the AndroidRushStatementRunner which would let you run raw sql.

Can you explain your use case for wanting this? If I was going to add this feature to the library I would need to know why.

@ppamorim

This comment has been minimized.

Show comment
Hide comment
@ppamorim

ppamorim Apr 28, 2015

I need erase the all data of a table. Like truncate. Just delete.

ppamorim commented Apr 28, 2015

I need erase the all data of a table. Like truncate. Just delete.

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell Apr 29, 2015

Owner

Is there are problem with doing this?

RushCore.getInstance().delete(new RushSearch().find(Object.class));
Owner

Stuart-campbell commented Apr 29, 2015

Is there are problem with doing this?

RushCore.getInstance().delete(new RushSearch().find(Object.class));

Stuart-campbell added a commit that referenced this issue May 5, 2015

How to delete/drop/empty whole database #32, Customizable table name #31
, Database migration issue #30, How to clear a table? #27,

 Edit New issue
How to execute SQL? #26
@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell May 5, 2015

Owner

Delete all added in v1.1.4

RushCore.getInstance().deleteAll(Object.class);

That will delete all from a table.

Owner

Stuart-campbell commented May 5, 2015

Delete all added in v1.1.4

RushCore.getInstance().deleteAll(Object.class);

That will delete all from a table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment